Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Trying to bypass via tsql a database when it is offline Expand / Collapse
Author
Message
Posted Thursday, September 5, 2013 3:57 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, December 12, 2014 1:02 AM
Points: 823, Visits: 753
Yes and no.

That is, you can put your procedure in master and call it sp_somename. Then you can invoke it as

EXEC archer..sp_somename

The procedure will then execute in the context of the database you specified.

However, this is not supported and it could break, for instance if Microsoft ships a system procedure with name you use. Or it just stops working.

Note here that the procedure name must start with sp_.


Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1491984
Posted Friday, September 6, 2013 12:06 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 6:24 AM
Points: 231, Visits: 813
That is very good news. I found a way of doing the procedure not knowing that you can do it the way you had mentioned. I will try it your way now and determine which is better. Thanks alot for your assistance.

Patti
Post #1492354
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse