Click here to Skip to main content
15,903,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone ,

I am working on a database merging concept in this i am having many of the table column identity (1,1) . Now my problem is while merging the old DB the Id starts from number but not from beginning its then identity seeding by 1 . Now i have create a new table in new DB and copy pasting the record but it starts from 1 , so i drop that table and remover the identity (1,1) from that table then copy paste but after pasting i cant again set the identity by design or by query .
Can anyone suggest me how can i take table data from one DB to another DB without doing changes to data in table.

Thanks in Advance
Maciej Los 13-May-13 5:49am    
Please, be more specific and provide more details. We can't read in your mind. We need the example data and the structure of tables, and your update/insert query.
gvprabu 13-May-13 6:51am    
If u want to set that column as Identity or anything u tries and got error.

1 solution

You need to set up the new column with identity(1,1), temporarily disable the auto-generate while you populate it with the data from the old DB, and then going forward it should work ...

Have a look at SET IDENTITY_INSERT[^] to get you started
Share this answer
Maciej Los 13-May-13 6:56am    
Probably this is it!
gvprabu 13-May-13 7:08am    
yes correct we can make the Identity Column Set ON or OFF. In case of his MERGE Source data have duplicate values then once ON the Identity Property then sure he ll get Error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900