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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Stored Procedure

Author  Topic 

askmaan
Starting Member

1 Post

Posted - 2010-11-17 : 09:47:58
Hello,
Can anybody tell me how can I run stored procedure on SqlServer1 to select data from database locating on SqlServer2?

Thank you very much for your help

Maan

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-11-17 : 10:00:24
Link the other server and then use four part name in select statement.
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2010-11-17 : 10:01:26
linked server
Go to Top of Page

parody
Posting Yak Master

111 Posts

Posted - 2010-11-17 : 11:20:00
If you are unable or not allowed to use linked servers, this can also be achieved with OPENROWSET

[url]http://msdn.microsoft.com/en-us/library/ms190312.aspx[/url]
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-11-17 : 11:28:39
quote:
Originally posted by NeilG

linked server



Have a look at
http://msdn.microsoft.com/en-us/library/ms188279(v=SQL.90).aspx
Go to Top of Page
   

- Advertisement -