Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Import External Data Tool Uses Timestamp Instead Of Datetime

forums forums SQLyog Using SQLyog Import External Data Tool Uses Timestamp Instead Of Datetime

This topic contains 2 replies, has 0 voices, and was last updated by  peterlaursen 6 years, 1 month ago.

  • Author
    Posts
  • #12920

    kipthegreat
    Member

    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?

  • #34157

    sathish
    Member

    Hello,

    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.

    Regards,

    Sathish

  • #34158

    kipthegreat
    Member

    That solved it. Thanks!

  • #34159

    peterlaursen
    Participant

    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.

You must be logged in to reply to this topic.