Migrate SQL Server DateTime column to DateTimeOffset
I have an old table with a few rows that has a datetime column. I want to switch this to datetimeoffset but i want to be able to transfer the data that already exists. So I'm doing something like: SET IDENTITY_INSERT Table_Temp ON INSERT INTO Table_Temp (Col0, ... ColN,) SELECT COl0,.... ColN, from Table_Original; SET IDENTITY_INSERT Table_Temp OFF This works but the offset set is 0 when i do the dattime to datetimeoffset assignment. Fortunately the offset that i want to set it to is the offset of the current system. I'm no tsql guru but i can't seem to figure out an easy way to do this. I