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
 Old Forums
 CLOSED - General SQL Server
 Remore Stored Procedure Run ?

Author  Topic 

akashmavle
Starting Member

1 Post

Posted - 2003-07-14 : 09:50:37
Dear All,

I have a simple question, say I have two machines ons is IP1 and another is IP2, both running MS SQl 2000

Now can I create a Sp on IP1 which will run on tables of IP2, provided that I have all the rights ?

Best regards,

Akash Mavle


X002548
Not Just a Number

15586 Posts

Posted - 2003-07-14 : 10:01:08
Yes

Look up sp_addlinked server in books online (BOL)

The reference the tables as linkedServerName.database.owner.table




Brett

8-)
Go to Top of Page

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2003-07-14 : 10:03:38
First IP2 will have to be a lined server to IP1.

Second use the four part name (fully qualified) of the objects you want to query. ex...

select *
from IP2.MyDb.dbo.CustomersTable

Check BOL for information on linked servers to get setup and there is a another section of the same topic dealing with distributed queries.

hth,
Justin

"Look at it out there orbiting like it's so cool, we will rule it with an army of replicants!"
Go to Top of Page

JustinBigelow
SQL Gigolo

1157 Posts

Posted - 2003-07-14 : 10:04:28
Looks like I was a little slow on the draw.

"Look at it out there orbiting like it's so cool, we will rule it with an army of replicants!"
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-07-14 : 10:06:20
Yes, but you're still a sql gigolo, and I'm still a number (but not just...)



Brett

8-)
Go to Top of Page
   

- Advertisement -