Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SELECT * from Servername/EitherIP Address.pharma.dbo.general_master WHERE NOT EXISTS(SELECT * FROM Servername/EitherIP Address.pharma1415.dbo.general_master WHERE ( Servername/EitherIP Address.pharma.dbo.general_master.gmCode= Servername/EitherIP Address.pharma1415.dbo.general_master.gmCode))
Posted
Comments
Ron Beyer 14-Jan-14 0:31am    
Thanks for the code dump, did you have a question?

1 solution

If the two servers are set up as Linked Servers in SQL Server
C#
Insert Into Server1.Database1.dbo.Table1 (Col1, Col2)
Select Col1, Col2 From Server2.Database2.dbo.Table2;


Try it..
 
Share this answer
 
Comments
manoj s sherje 14-Jan-14 1:13am    
i ma use this and i want also WHERE ( Servername/EitherIP Address.pharma.dbo.general_master.gmCode= Servername/EitherIP Address.pharma1415.dbo.general_master.gmCode))
Christian Graus 14-Jan-14 16:51pm    
You can use any clause you like. Once the linked servers are set up, you can write SQL as if they were the same server, and it all works the same ( of course, it could be slower, depending on where the two servers are )

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