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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Database, primary keys, and indexes.

Status
Not open for further replies.

xtendscott

Programmer
Apr 21, 2003
276
US
I have a MSSQL database on a web host, where I have a web application that I want to create another similar one. Rather than having to request a backup of the database then restore to another database, I tried copying the tables over. This copied the tables and data, but primary keys, indexes and "auto INT" do not transfer.

Is there a way to do this?

xtendscott
Home Improvement Watch | Cryosurgery | Walla Walla Portal | Walla Walla Martial Arts
 
Use "Copy objects" option instead of "Copy tables".

Btw. be careful with "Copy dependent objects" option that appears in dialog later (aka: for starters, turn it off).

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Nope... copy the objects directly.

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top