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 05, 2013 3:57 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 4:43 AM
Points: 756, Visits: 631
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 06, 2013 12:06 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, April 07, 2014 3:06 PM
Points: 226, Visits: 790
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