﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Database Deployment Toolkit » Database Deployment Toolkit (How do I?)  » Error converting DateTime field to DateTime2 in SQL2008  with DDT</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 29 Apr 2026 09:24:37 GMT</lastBuildDate><ttl>20</ttl><item><title>Error converting DateTime field to DateTime2 in SQL2008  with DDT</title><link>http://forum.strataframe.net/FindPost22694.aspx</link><description>Hi Trent,&lt;br&gt;
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:&lt;br&gt;
[quote]&lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt; Altering table 'Inventory' failed.&lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt; FailedOperationException        &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt;   Alter failed for Table 'dbo.Inventory'.         &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt; ExecutionFailureException        &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt;   An exception occurred while executing a Transact-SQL statement or batch.        &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt; SqlException        &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt;   Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.        &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt;         &lt;br&gt;
X 4/13/2009 1:50:05 PM	-&gt; Source     : Microsoft.SqlServer.Smo        &lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
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?&lt;br&gt;</description><pubDate>Mon, 13 Apr 2009 16:55:36 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Error converting DateTime field to DateTime2 in SQL2008  with DDT</title><link>http://forum.strataframe.net/FindPost22696.aspx</link><description>Thanks Trent, I will play with the scripts to handle this.</description><pubDate>Mon, 13 Apr 2009 16:55:36 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Error converting DateTime field to DateTime2 in SQL2008  with DDT</title><link>http://forum.strataframe.net/FindPost22695.aspx</link><description>No...this is an entirely different data type.&amp;nbsp; So the DDT (at present) doesn't automatically perform this conversion for you so you will have to handle this at the moment.&amp;nbsp; At some point I will look to see if we can integrate this...but today...you will have to do it. :)</description><pubDate>Mon, 13 Apr 2009 16:29:21 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>