• OK, but I'm still a little surprised about this outcome.

    Let's recap, using a different model.

    Suppose the following:

    - I have different versions of a stored procedure called sp_x in BOTH Master and NotMaster databases

    - I am currently in the NotMaster database

    - I have not run sp_ms_marksystemobject

    If I now enter 'Exec sp_x' while in NotMaster, I am ALWAYS going to run the version in NotMaster.

    So why does Sql Server ever bother to check the Master database for this sp, since it's never going to override the local shadow? It sounds a bit like using IIF in VBA, where both the False and True execution statements are evaluated.

    To me a more logical method would be for Sql Server to check the current database for the existence of sp_x. If found, compile and run the thing, and that's it. Only if not found does Sql Server then need to look in Master.