How can I view all grants for an SQL Database?

前端 未结 5 948
无人共我
无人共我 2020-12-31 00:49

I am using SQL Server 2005, I want to find out what all the grants are on a specific database for all tables. It would also help to find out all tables where the delete gran

5条回答
  •  醉酒成梦
    2020-12-31 01:49

    To view all grants on a specific database use this:

    Select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES
    

    To just view delete grants on a specific database use this:

    Select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE PRIVILEGE_TYPE = 'DELETE'
    

提交回复
热议问题