• I too thought it would return 'this'.

    I've read the documentation about 'sp_' and system stored procedures but I've always misunderstood until now.

    The documentation doesn't really make clear what is a system stored procedure.

    I always assumed it meant: any stored procedure defined in the master database, including the pre-defined routines that come with SQL Server.

    Now I understand that system stored procedure only refers to the pre-defined routines.

    So when SQL Server sees a stored procedure name starting with 'sp_':

    First it checks to see if it is a pre-defined routine (like sp_who).

    Then it checks the current database.

    Then it checks the master database.

    I think Microsoft needs to rewrite its documentation to make this clearer.