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.
Author |
Topic |
cornall
Posting Yak Master
148 Posts |
Posted - 2009-03-20 : 07:49:32
|
Hi,I archived a bunch of data out of a database and now there is a requirement to restore some records.These records have forign key relationships with each table involved.Is there anyway to reinsert them using their old identity column values which I have in the backup.e.g.Original Data1 sometext2 sometext3 sometext4 sometext5 sometextAfter Arive1 sometext2 sometext5 sometextAfter normal reinsert1 sometext2 sometext5 sometext6 sometext7 sometextWhat I want to get back to1 sometext2 sometext3 sometext4 sometext5 sometextWhere 1,2,3,4,5 is my auto incrementing identity column.Cheers Dave |
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-20 : 08:09:30
|
You can insert to identity column by setting SET IDENTITY_INSERT ON. |
|
|
cornall
Posting Yak Master
148 Posts |
Posted - 2009-03-20 : 08:10:16
|
Works perfectly thanks |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-03-20 : 08:11:16
|
np |
|
|
|
|
|