No announcement yet.

Copying Identity fields from MYSQL to MSSQL

  • Filter
  • Time
  • Show
Clear All
new posts

  • Copying Identity fields from MYSQL to MSSQL

    I have a table with an auto-increment field in MySQL and and a corresponding Identity field in MSSQL.

    I need to copy the data from the MYSQL table to the MSSQL table and preserve the ID's from the MYSQL table.

    But it won't do it because identity insert is off.

    In order to copy data (with the identity) from one table to another, you have to first run the command:

    set identity_insert tablename on

    But when you do that it is only for that session, so I can't run it on the server and then do a data transfer. The identity on is only for the session it was run in.

    Could you PLEASE add this as an option when copying data to MS SQL?

    (or if there is a better way, I'm willing to listen!)

  • #2
    We would like your assistance to identify the problme. Please provide us the following information. You can send the information to , we will reply you through email.

    1. Your Navicat version, e.g. Navicat Premium (Windows) 11.2.15
    2. Screenshots showing the Data Transfer settings, i.e. General, Advanced tab.
    3. All error messages shown in Message Log
    4. The structure of the source and target tables. (in Navicat main window, right-click the table and choose Dump SQL File > Structure Only)