SQL Server – Import Export Wizard – Enable Identity Insert
I had requirement to move the data from source table with his identity column to destination table that have also identity column.
Identity columns are commonly used as primary keys in database tables. These columns automatically assign a value for each new row inserted. Identity column does not allow any kind of insertion from the user.
Before starting I was thinking I need to enable the IDENTITY_INSERT on the destination table by using
SET IDENTITY_INSERT myTable ON and once I will move the data then will OFF the IDENTITY_INSERT by using SET IDENTITY_INSERT myTable OFF.
When I checked the SQL Server – Import Export Wizard then I checked that there is one option “Enable Identity Insert” that made my task easy.
If we enable that option (i.e. Enable Identity Insert) it allows the values to be inserted in the identity field. This way, the exact identity values are moved from source database to destination table.
I get Create Statements for database and table structure, but may i get insert script for the data. I have done with concept of CSV but facing an issue in that, can you suggest how i can get the insert script corresponding to the database
As insert script will ease my work to insert too large amount of data into Cassandra db from SQL Server 2005