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
 General SQL Server Forums
 New to SQL Server Programming
 creating objects in other database

Author  Topic 

svicky9
Posting Yak Master

232 Posts

Posted - 2005-09-25 : 16:30:33
Hi

There are 2 databases A and B.How can I create a procedure in database A so that the procedure works with contains tables in Database B.
IS IT POSSIBLE

vic


Vicky

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-09-25 : 17:34:49
CREATE PROCEDURE myProc AS
SELECT * FROM DatabaseB.dbo.myTable


Nothing more complicated than using 3-part naming conventions (database.owner.object) in your procedure.
Go to Top of Page
   

- Advertisement -