Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2009-05-31 : 02:12:05
|
| Is there a way I can query another server (in a stored procedure)Like i'm on server yyyy and I want to query server xxxx.dbo.mydb.users is this possible? I assume I would have to pass the user credentials somewhere in the query but where? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-31 : 02:13:32
|
check out linked server KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
a.rameshk
Starting Member
19 Posts |
Posted - 2009-05-31 : 03:44:45
|
| As we want to access the data from other server.First we need to create Linked server using sp_addlinkedserver syntax.After successfully creating the linked server we can write a query like this and get the data.For Eg: SELECT *FROM LinkedServer.DatabaseName.dbo.TableName. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-31 : 06:25:28
|
| if its for an adhoc access you can use OPENDATASOURCE which does not require setting up a linked server connection. |
 |
|
|
|
|
|