Thursday, November 13, 2008

Run query from another computer in SQL Server

DeviceName is the name of another sqlinstance

EXEC sp_addlinkedserver @server='sqlinstance', @srvproduct='',@provider='SQLOLEDB',@datasrc='sqlinstance\instance1'


EXEC sp_addlinkedsrvlogin 'sqlinstance', 'false', NULL, 'sa', ''

select * from sqlinstance.Table.dbo.linklist

No comments:

Post a Comment