• Chris Howarth (8/10/2009)


    I disagree with point 7 - regarding the sp_ prefix, try the example below.

    What he said is mostly true. It was true on SQL 2000 (if I recall). On 2005, the check is first done to the MSSQLSystemResource Database (a hidden system DB). If I recall (haven't tried it) it is still possible to get resolution to master with a proc starting with sp_ but the proc in master must be marked as a system object.

    Still, if you check with profiler, a call to a proc that starts with sp_ does have SQL check DBs other than the current one first.

    Easy way to show that there's some odd name resolution happening.

    CREATE PROCEDURE sp_help

    AS

    SELECT 'My Local version of sp_help'

    GO

    exec sp_help

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass