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 2005 Forums
 SQL Server Administration (2005)
 copying Tables structure and Values to another DB

Author  Topic 

TMDOSS
Starting Member

33 Posts

Posted - 2010-06-14 : 16:21:10
I created 5 different Tables with relationship between all the tables
in the test. Now I want to move all these 5 tables to Production.
if I created the Tables with SQL Scripts and copy the data it failes becuase of the Identity column values.
How can I move the tables with values with keys and identity values

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-14 : 17:11:07
You can use the SET IDENTITY INSERT option to move the identity values too. Or just exclude the identity column from the INSERT statement to let SQL Server manage it for you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TMDOSS
Starting Member

33 Posts

Posted - 2010-06-15 : 08:47:26
Thanks. I already tried that, but the relationship doesn't carry over to the new database

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-15 : 12:30:05
Well you have to script it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -