Toad World® Forums

Issue while altering datetime2 datatype

I have an existing table with an existing column named sample_time and the datatype is datetime. I need to alter the table and change the datatype from datetime to datetime2. If I right click on the table and choose Alter Table… I get the alter table tool and I change the datatype from datetime to datetime2(7). When i click OK, I get this error.

3-26-2014 11-23-17 AM.jpeg

When I look at the SQL script that is automatically generated I see this.

3-26-2014 11-26-47 AM.jpeg

I can copy the script to the editor and change the 18 to a 7 (as it should be). Then the script will execute and change my datetime to datetime2 without an error. I searched MSDN for the datetime2 datatype and 18 is not a valid fractional precision.