Using one stored procedure with multiple databases

RevolutionDev
RevolutionDev used Ask the Experts™
on
I'm creating a stored procedure in SQL Server 2000, and in the stored procedure, I have no problem manipulating data in the database I'm in.  However, I also need to access data from a completely different database on a completely different server.  Can I do so in that same stored procedure?  
(maybe using ADO? or maybe create another stored procedure in that 2nd DB and call it from the original stored procedure?--help!)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Commented:
Sure.  Just the link the second database to the first Server.  You would then use as follows:

Select Table1.*
From   LinkedServer.dbo.databasename.Table1

Anthony

Author

Commented:
Sounds good Anthony.
Thanks!
RevolutionDev

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial