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

duplicating data

Status
Not open for further replies.

beechill4

Technical User
May 10, 2005
207
IE
Hi,

i have a 2000 database with 71 tables.

this database has autonumbers, primary keys, check constraints and foreign keys.

I have created a dts package to import the data from this database into the same tables where i am exporting from i.e a complete duplication of th 71 tables.

hwoever, i am having probelms with pk's. how do i over come this?
 
Are you doing a complete database replace or just selecting the 71 tables you want to transfer? If you are replacing the entire database, you can use the Copy Database Task (you will have to delete the destination database first).

Unfortunately if you are only copying tables from one to the other, you will have to deal with the primary key and Identity field issues.

Other options to consider are replication or log shipping if you are just looking to keep the tables in sync.
 
hi,

i just want to multiply the existing database for testing and performance purposes.

i.e if a table has 200 rows, i need it to have 400 etc.

Thanks
 
Ahhh - got it!

I would suggest you create (INSERT INTO Table1 / SELECT FROM Table1) SQL statements ignoring the IDENTITY fields from the SELECT fields list.


It's obviously alot more work but will eliminate the PK issue assuming the PK fields are also the IDENTITY fields

 
hi gradley,

i am trying that now and will report back to you

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top