I have been assisgned with a starnge assigment where i need to convert 40 tables columns from datetime2 to datetime.
this is the datetime format what i am having in my database.2007-11-12 00:00:00
it contains more than 90,000 records
Please assist
datetime
). For exampleSELECT * FROM MyTable WHERE MyColumn < '1753-01-01'
UPDATE MyTable SET MyColumn = '1753-01-01' WHERE MyColumn < '1753-01-01'
ALTER TABLE MyTable ALTER COLUMN MyColumn DATETIME
that is just rediculos, datetime2 is more exact, it has a bigger daterange and takes up the same number of bytes (8).
here is the code for mssql:
alter table tablename alter column colname datetime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With