Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lose relationships on table copy 1

Status
Not open for further replies.

kevinforbes

Programmer
Apr 3, 2002
27
0
0
CA
Hi there,

I copied my tables from one database to another and found that the primary keys and relationships are all deleted in the destination database. Any idea why?

thanks,
K
 
Hi there,

how did you copy your tables to the new database?

I like to script my database, including scripting all the
primary keys, relationships etc so that i don't lose them
in the process.

Transcend
[gorgeous]
 
I just imported them using Enterprise Manager, I really don't want to have to script the copy since it is around 25 tables and relationships.

tx,
K
 
Did you select Copy table(s) and view(s) from source database or Copy objects and data between SQL Server databaseson the Specify Table Copy or Query screen? If you choose the first option, just tables and data will be copied. Objects not in the destination database will be scripted and created.

If you choose the 2nd option above (it is the 3rd option on the selection screen), SQL should copy indexes, primary and foreign keys. Terry L. Broadbent - DBA
SQL Server Page:
If you want to get the best answer for your question read faq183-874.
 
Thank you, I must have done the first, I will try the 2nd option.

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top