Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 inserting data between two sq servers

Author  Topic 

rudba
Constraint Violating Yak Guru

415 Posts

Posted - 2010-10-21 : 14:53:29
How to insert dada from one sql server's db to another sql server's db by t-sql

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-21 : 14:56:06
If they are in the same instance, then just do this:

INSERT INTO Table1 (...)
SELECT ...
FROM Db1.dbo.Table1
...

If they are on separate instances, then do the same except with a linked server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -