SQLyog, sqlserverdatetime to mysqldatetime

Source: Internet
Author: User
If SQLyog is used to import data from sqlserver to mysql, SQLyog converts datetime to timestamp in case of a datetime field. The timestamp time range of mysql is 1970-01-0108: 00: 01and2038-01-1911: 14: 07. In this way, the 1900-01-0100:00:00 day in sqlserver

If SQLyog is used to import data from sqlserver to mysql, SQLyog converts datetime to timestamp in case of a datetime field. The timestamp time range of mysql is '2017-01-01 08:00:01 'and '2017-01-19 11:14:07 '. In this way, the day of '2017-01-01 00:00:00 'in sqlserver

If SQLyog is used to import data from sqlserver to mysql, SQLyog converts datetime to timestamp in case of a datetime field.

The timestamp time range of mysql is '2017-01-01 08:00:01 'and '2017-01-19 11:14:07 '.

In this way, the date of '2017-01-01 00:00:00 'in sqlserver becomes '2017-00-00 00:00:00' when it reaches mysql, and the data is forcibly converted.

If you do not want to be forcibly converted, You have to manually adjust it to datetime before importing the table to mysql. If there are many datetime fields, it is too troublesome to adjust them one by one.

However, SQLyog does not have a uniform setting. In this case, the following method can meet the requirements:

Use SQLyog's Import External Data tool

1. Create a job file. "Start a new job"-> for a series of configuration steps, refer to the online tutorial-> select the table to be imported-> Run immediately unselect, select saving options, save job file-> store the job file locally

2. Edit the job file and replace timestamp with datetime in batches.

3. Use this job file for import. Re-open the Import External Data tool and use Edit a saved job to select job file for Import.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.