Checking procedure privilege by T-SQL

  • Hi all,

           When we want to check the access privilege of a particular table, we can use "exec sp_table_privileges <table_name>" in T-SQL. Is there a similar built-in stored procedure to check the execute privilege of a stored procedure, from T-SQL?

    Thank you,

    delpiero

     

  • System procedure sp_MSobjectprivs can be used with all types of objects.

    -- Table

    exec Northwind.dbo.sp_MSobjectprivs @objname = 'dbo.Customers'

    -- View

    exec Northwind.dbo.sp_MSobjectprivs @objname = 'dbo.Alphabetical list of products'

    -- Stored Procedure

    exec Northwind.dbo.sp_MSobjectprivs @objname = 'dbo.Sales by Year'

    SQL = Scarcely Qualifies as a Language

  • Thanks a lot Carl.

    delpiero

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

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