Tuesday, March 06, 2012

openrowset

sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO

SELECT a.*
FROM OPENROWSET('SQLNCLI', 'ip';'sa';'password',
'SELECT *
FROM tbl'
) AS a;

No comments: