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

trying copy table to other server (both in the enterprise manager)

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
DE
Dear SQL users,

We are trying to copy a table to an other server database, both servers are in the enterprise manager (2000).Inside the same server it is very easy to copy a table to an other database with the next syntax:

Select * into targetdb.dbo.tbl_a from sourcedb.dbo.tbl_a

Is it possible to copy a table to an other server. If yes, can someone pls give the source?Nice regards,Michelle.

Nice regards,

Michelle.
 
To do it via T/SQL you will need to setup a linked server. This can be done within Enterprise Manager.

Open the Server, Security, Linked Servers. Right click on linked servers, and setup the fields as needed.

Once the linked server is setup you can do it from the destination server.
Code:
Select * 
into targetdb.dbo.tbl_a 
from [COLOR=red]source_server.[/color]sourcedb.dbo.tbl_a

You can also use the Export Data wizzard to do this.

Or you can create a DTS package manually to do it.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
We found out that the right syntax is:

[from source_server].sourcedb.dbo.tbl_a

Thanks a lot for your excellent information

Michelle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top