Lock Down sp_helptext

  • I have a Stored Procedure that has the "sa" password embedded within it. It resides in the MASTER database.

    How can I LOCK it down or DENY anyone READ/VIEW access to it, other than Sytem Admins?

    With "sp_helptext" others can still read the code.

    ...thanks

  • In the master database:

    REVOKE EXECUTE ON sp_helptext FROM public;

    This will drop the only permissions given to execute this stored procedure. That means only a member of the sysadmin fixed server role, which don't undergo security checks, will be able to execute this stored procedure.

    BTW, if you have an issue with your SQL Server, you may need to re-add this permission before receiving assistance from Microsoft. Technically, altering the permission puts you in a non-supported state. However, it doesn't break anything running to do so.

    K. Brian Kelley
    @kbriankelley

  • Thank you very much!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply