How to make a stored procedure readonly

  • Hi,

          I have created a stored procedure in Master database.I want to make it readonly, so that no one can change it.How to do it?

    Thankds & Regards

    Niladri


    Thanks & Regards,

    Niladri Kumar Saha

  • you can do this by setting nessesary permisions




    My Blog: http://dineshasanka.spaces.live.com/

  • First of all you shouldn't be putting non-Microsoft supplied items in the system databases.

    Given an appropriate tool, such as Query Analyzer, users in the public role can view the stored procedure code, but they don't have permission to change it. Any user that has db_ddladmin privelages in the database that the stored procedure is located in will be able to change the procedure.

    You can use the sp_dbfixedrolepermission procedure to list out the permissions for the roles. Check Books Online for full details.

     

    --------------------
    Colt 45 - the original point and click interface

  • Agree with Phil - your better off having your own DBAUtil database. You could also encrypt the stored proc, but remember to keep the source in source safe (or the like) so you don't have to go through the hassle of unencrypting

  • Ah yes you could use encryption, forgot about that one. I generally keep away from it because it can cause more problems than it's worth . There are also a few publically documented methods of decrypting as well

     

    --------------------
    Colt 45 - the original point and click interface

Viewing 5 posts - 1 through 4 (of 4 total)

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