Sunday, October 20, 2013

Selecting data from two Different SQL Servers

For selecting the data from two databases of two different servers, first we have to link the two servers.

sp_addlinkedserver('servername')

Then you can run the query like,

select * from Table1
unionall
select * from [server2].[database].[dbo].[Table1]

No comments:

Post a Comment