Reputation: 2973
is it possible to do something like
select * from [anotherserver].somedatabase.dbo.employee
[anotherserver] is on same network as my current SQL server.
Upvotes: 2
Views: 82
Reputation: 46
In sqlServer you can do :
SELECT *
FROM OPENROWSET(
'SQLOLEDB',
'Server=yourServer;Uid=yourID;Pwd=yourPWD;Database=yourDB',
'select somfield1,somefield2 from yourTable'
) AS alias
But you got to be really carefull with the quote character ( ' ), be sure you have a correct string.
Upvotes: 1
Reputation: 52645
Yes with linked servers see Linking Servers on MSDN and also this article on how to use sp_addlinkedserver
Upvotes: 4