Link to home
Create AccountLog in
Avatar of DJMikeh
DJMikehFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Copy data between 2 tables on 2 different database's

Hi,

We have a SQL 2000 server and unfortunatly about 2000 records have been deleted from 4 tables within the system, now I have a backup from last night, however I CANNOT restore the entire backup due to the nature of the DB and data held on it. However, the data that is missing all relates to one 'entity' and so can be found by filtering by their primary ID called accountno.

So I have 2 databases GAM and GAMRESTORE, now I need to copy all the rows of data found in the CONTACT1, CONTACT2 and CONTHIST tables from GAMRESTORE into GAM where the accountno (primary key) is equal to 44053. Both database's in regards to table's are exact.

How can I do this? I only need the rows that have the ID of 44053 ....

Thanks
Mike
ASKER CERTIFIED SOLUTION
Avatar of amcnerlin
amcnerlin

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Obadiah Christopher
Have you tried this query?

select * from gamrestore..contact1 into
gam..contact1 where gamrestore..contact1.accountno = 44053
Avatar of DJMikeh

ASKER

Thanks