I am moving data from different source types like Oracle, MySQL, Access, Sharepoint etc to SQL.
A SQL script is generated in c# like this:
with cte (ID, changedate, SupplierID)
as (
SELECT 1720, '1997-12-17 12:00:00 AM', 763
UNION ALL
SELECT 1721, '1900-01-01 12:00:00 AM', 114)
select * into components8_2_2011_3 from cte
The datatime fields is created as varchar which is wrong.
In C# I can see that the column type is datetime, but MSSQL does not recognize the string as datetime.
How would I go about getting the above script to create a datetime field WITHOUT adding a CAST statement to the changeDate field?
How about using a “guide row”