views:

267

answers:

1

Is it possible to get data from remote server using JUST TSQL? I mean to do it just with script and without any actions (setting up linked servers and etc) on local server. Need to query something Like this:

SELECT * FROM dbo.Users WHERE UserID NOT IN (SELECT UserID FROM [192.168.1.100].dbo.Users)
+1  A: 

There are some ways to query remote servers via SQL (Remote Server, OPENQEURY), but i'm sure there is no way to query without setting up the connection in front.

But of cause you can set up your remote server connection using TSQL (see sp_addlinkedserver and sp_addlinkedsrvlogin)

Jan
made it with sp_addlinkedserver at last.. Thank you.
nihi_l_ist