Scenario LINK DB 1 in server 1 and DB 2 in server 2, to fetch the data from DB2 in DB 1
Creating a link in DB1
USE master;
GO
EXEC sp_addlinkedserver
N'server2',
N'SQL Server';
GO
--Set up login mappings.
EXEC sp_addlinkedsrvlogin N'server2', 'false', NULL, 'username', 'password';
GO
select * from [server2].[dbname].[dbo].[tablename]
No comments:
Post a Comment