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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Preserve IDs when porting data

Author  Topic 

ewomack
Starting Member

33 Posts

Posted - 2011-07-26 : 10:56:57
Hello,

I have to move some data from test to prod, but I need to preserve the IDs (in the identity column) when I do so. The Ids are not sequential and are tied to other processes, so the numbers need to match when moved.

I'll use SQL compare to port the schema, but if I use a general INSERT statement won't the new table seed the IDs numerically from 1 to n?

Thank you!

Ed Womack
www.getmilked.com

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-07-26 : 11:02:02
SET IDENTITY_INSERT

Also, if you use SSIS to move the data, there is a check box to keep identity values.
Go to Top of Page

ewomack
Starting Member

33 Posts

Posted - 2011-07-26 : 14:33:48
Ah! Cool. Thank you much, I will read up.

Ed Womack
www.getmilked.com
Go to Top of Page
   

- Advertisement -