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 2000 Forums
 SQL Server Development (2000)
 Can I create a stored procedure across servers?

Author  Topic 

istock1
Starting Member

4 Posts

Posted - 2008-01-07 : 15:24:56
All,

I am trying to create a stored procedure that will compare the number of rows in each table (using the sysindexes table) in one database with the number of rows in each table in another database on a different server. Does anyone know if this is possible? I have tried using three-level names (server.db.sysindexes) with no luck...

Thanks!

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-01-07 : 15:34:08
you have to set up linked servers and use 4 part naming convention:
server.database.owner.table

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page

istock1
Starting Member

4 Posts

Posted - 2008-01-07 : 16:39:30
Spirit,

Thank you for the quick response. Could you explain how to set up linked servers, or at least point me in the right direction?

Thanks again!
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-01-07 : 16:49:06
[url="http://msdn2.microsoft.com/en-us/library/aa213778(SQL.80).aspx
"]Configuring Linked Servers
[/url]

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out
Go to Top of Page
   

- Advertisement -