Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Copy data, including Identity column

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2013-05-25 : 14:33:50
I am trying to the data from my prod db to my dev db but it keeps failing when it trys to insert the identity column's data. I have been trying to use the SQL SErver Import and Export Wizard to copy the data. The failer error I get is "fauilure inserting into the read-only column". How can I go about importing all this data?

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2013-05-25 : 15:07:48
There is a checkbox in the Import/Export Wizard that says "Allow Identity Insert."

Check it.
Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2013-05-25 : 17:10:47
Took me a bit but i found that option under the edit mappings box. Never looked there since I was just doing a data move from one db to another with identical table setups.

Unfortunatly that is not working either, now it is failing with the error" The INSERT statment conflicted with the FOREIGN KEY constraint"

--
If I get used to envying others...
Those things about my self I pride will slowly fade away.
-Stellvia
Go to Top of Page

MuMu88
Aged Yak Warrior

549 Posts

Posted - 2013-05-25 : 20:22:24
Follow-up : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=185592
Go to Top of Page
   

- Advertisement -