0

There are two server
1)192.168.*.*
2)192.162.*.*

In first server there is database call department which contain table called employee
Now i want to copy the from above to second server in database company which contain table employee

2
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by BitBlt
0

Just use SSIS. It is easiest.

Alternative: use a linked server. You can look in BOL and read about sp_createlinkedserver. You can use this to dynamically create/destroy your link so you minimize your security window.

0

Thank for your reply
But i want to write the select with insert for the same.
I googled it but i am not getting.

0

Understood, and I'm sorry my answer didn't help.

However, in order to copy data between one server (or instance) and another, you will have to use one of these techniques. SQL Server does not allow you to write a single select to move data from one server to another without establishing a connection via linked server or using SSIS or some other integration tool. Please do look at the transact-sql help file (a.k.a. "BOL") and see how linked servers work. Once that link is established, you can use the form

insert into dbo.mytable
select * from [LinkedServer].[Database].[Schema].[Table]

where each node corresponds to linked server name, database name, schema name (usually dbo) and table name. You can even join the tables across these links, although performance may not be great.

0

Should be in your client tools "Help" menu when you create a query. Alternatively you can go to the Microsoft web site and search for it there.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.