StrataFrame Forum

Error converting DateTime field to DateTime2 in SQL2008 with DDT

http://forum.strataframe.net/Topic22694.aspx

By Edhy Rijo - 4/13/2009

Hi Trent,

Today I upgraded my dev computer to SQL2008, I want to take advantage of the new DateTime2 and Date fields in SQL2008, after changing one of table in the DDT to use DateTime2 and deploying the package I got the following error:



X 4/13/2009 1:50:05 PM   -> Altering table 'Inventory' failed.

X 4/13/2009 1:50:05 PM   -> FailedOperationException

X 4/13/2009 1:50:05 PM   -> Alter failed for Table 'dbo.Inventory'.

X 4/13/2009 1:50:05 PM   -> ExecutionFailureException

X 4/13/2009 1:50:05 PM   -> An exception occurred while executing a Transact-SQL statement or batch.

X 4/13/2009 1:50:05 PM   -> SqlException

X 4/13/2009 1:50:05 PM   -> Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.

X 4/13/2009 1:50:05 PM   ->

X 4/13/2009 1:50:05 PM   -> Source : Microsoft.SqlServer.Smo





Shouldn't the DDT take care of running whatever command is required to do this type of conversions? or this must be handle via the Pre/Post script?
By Trent L. Taylor - 4/13/2009

No...this is an entirely different data type.  So the DDT (at present) doesn't automatically perform this conversion for you so you will have to handle this at the moment.  At some point I will look to see if we can integrate this...but today...you will have to do it. Smile
By Edhy Rijo - 4/13/2009

Thanks Trent, I will play with the scripts to handle this.