Click here to Skip to main content
15,902,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Can anyone tell me, how to insert the records from one table to another table, where servers are different, Suppose I have one table name Company on Server 'Development' which consist thousands of records now I want to insert all the data of this table to another table which is on another server Quality analyst.


Regards
Raman
Posted

Hi,
try this

SQL
insert into SourceServer\instance.Database.Table
select * from DestinationServer\instance.Database.Table with (nolock)


Or
you can establish a connection via linked server or using SSIS or some other integration tool. Once that link is established, you can use the form

insert into dbo.mytable
   select * from [LinkedServer].[Database].[Schema].[Table]
 
Share this answer
 
Try this

Insert into [database_name]..[table_name]
select [columns_to_be_inserted] from [database_name]..[table_name]

Hope this will work.
Please mark if it work.

Thanks
 
Share this answer
 
v2
Comments
Ambivert 1-Aug-13 0:34am    
How one database instance will connect to another instance by the query you wrote it will never work Ashish

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900