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 12345»»»

system stored procecures Expand / Collapse
Author
Message
Posted Monday, August 22, 2011 8:28 PM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Wednesday, January 2, 2013 12:15 PM
Points: 1,443, Visits: 711
Comments posted to this topic are about the item system stored procecures
Post #1163694
Posted Monday, August 22, 2011 8:29 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:50 PM
Points: 5,618, Visits: 25,235
Nice to be reminded of basic how things work ....

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1163695
Posted Monday, August 22, 2011 9:44 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, February 22, 2012 11:15 PM
Points: 130, Visits: 404
The results could depend on the existence of database test2...
Post #1163698
Posted Monday, August 22, 2011 10:43 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, August 28, 2013 7:06 AM
Points: 1,216, Visits: 308
A basic question but SQL script is poor. Though my answer was correct. But I cannot deny bits of fire from folks

--Sudhir
Post #1163707
Posted Monday, August 22, 2011 10:50 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 13, 2011 12:44 AM
Points: 18, Visits: 30
Important If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed. (from Microsoft)

then how it executes test2 sp instead of master db
Post #1163710
Posted Monday, August 22, 2011 11:21 PM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Sunday, June 29, 2014 11:26 PM
Points: 1,481, Visits: 1,960
So BOL is wrong. From the link

It is strongly recommended that you do not create any stored procedures using sp_ as a prefix. SQL Server always looks for a stored procedure beginning with sp_ in this order:

The stored procedure in the master database.

The stored procedure based on any qualifiers provided (database name or owner).

The stored procedure using dbo as the owner, if one is not specified.


Because running the example it most definatly runs the SP in the current database before the master database.

/T
Post #1163716
Posted Monday, August 22, 2011 11:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 23, 2011 3:03 AM
Points: 1, Visits: 5
From the Microsoft linked article, the master db gets searched first, so the version of the sp in there will run, correct? So either the answer to this question is wrong, or the MS documentation is wrong. Anyone sitting in front of an SQL server able to test this?

Of course anyone stupid enough to name their procs sp_ and fail to specify the db when execing deserves the uncertainties they get!
Post #1163719
Posted Monday, August 22, 2011 11:41 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, October 13, 2011 12:44 AM
Points: 18, Visits: 30
MS documentation is wrong as i tried and it exectue test2 DB sp instead of master db sp , but micrsoft says that it should first search in master db and it would run master db sp but here its behavior is different . unable to understand what's wrong with microsft
Post #1163720
Posted Monday, August 22, 2011 11:46 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, March 3, 2014 12:21 AM
Points: 2,122, Visits: 306
In SQL 2008 the script return 'that'. But the link point to an SQL 2000 document. Behavior might have changed...

Wait! Doesn't that mean, the answer 'that' is wrong, since it does not comply to the information provided by the linked document? I want my point back
Post #1163722
Posted Tuesday, August 23, 2011 12:46 AM
SSC Eights!

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

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 12:57 AM
Points: 965, Visits: 1,160
The answer is syntax error why should we assume the database test2 exist when it does not?

“When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris
Post #1163735
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse