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)
 Run procedure in context of current database...

Author  Topic 

tfountain
Constraint Violating Yak Guru

491 Posts

Posted - 2003-07-09 : 13:49:04
Is there a way to implement a procedure that when executed will run in the context of the current database? Without having to creating the procedure in every database or resort to dynamic SQL?

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2003-07-09 : 14:18:21
Put it in master and start it's name sp_


HTH
Jasper Smith

0x73656c6563742027546f6f206d7563682074696d65206f6e20796f75722068616e6473203f27
Go to Top of Page

tfountain
Constraint Violating Yak Guru

491 Posts

Posted - 2003-07-21 : 10:39:58
I was on vacation last week so I never had time to post back here to thank you for the info. It works like a charm. I knew it had to be in master but I forgot the sp_ part ;).

Go to Top of Page
   

- Advertisement -