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!

Question about copying data from tables.

Status
Not open for further replies.

Neozero

MIS
Jul 7, 2000
49
0
0
US
I have a database that I want to move data out of and into another database. The deal is, both databases are the same however one has more data than the other. What I want to do is move the data from the one that has more to the new database. I have about 5 months worth of data from last year that I need to put into my new database that started in January. I guess I want to call this data History that I am moveing from the old database to the new. Is there a function in SQL or a SQL Statement function that I should use to move this data ? Any suggestions would be helpful.



Neozero
 
Assuming both DBs on same server:

Code:
INSERT db2.dbo.tbl
SELECT *
FROM db1.dbo.tbl
WHERE <criteria>

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top