I am using the PowerTools/Import External Data tool to transfer SQL Server data to MySQL. I am running into a problem in that SQL Server DATETIME fields are created in MySQL as TIMESTAMP. I would like them to all be created as DATETIME.
The problem is that I have some dates in SQL Server that are less than 1970, and TIMESTAMP fields cannot go below the Unix Epoc (1970-01-01). Dates prior to 1970 come through as NULL values. DATETIME field type does not have this limitation.
I know that I can select the “Map” button for each field and change the data type, but I have 589 fields across 260 tables. Is there a way to tell it to globally use DATETIME field type for all SQL Server DATETIME columns?
What you can do here is create a job file by selecting the required tables from Import External Data Wizard. You can edit the job file and replace timestamp with datetime and run the job file. This will solve your problem.
Additinally it is not possible to distinguish a TIMESTAMP and DATETIME when using ODBC, as ODBC has only one data type for both. We map to TIMESTAMP as default (because we need to choose one of them), but user may need to remap.