File tree Expand file tree Collapse file tree
docs/relational-databases/system-catalog-views Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ title: "sys.database_permissions (Transact-SQL)"
33description : sys.database_permissions returns a row for every permission or column-exception permission in the database.
44author : VanMSFT
55ms.author : vanto
6- ms.date : 06/16/2023
6+ ms.date : 04/02/2026
77ms.service : sql
88ms.subservice : system-objects
99ms.topic : " reference"
@@ -180,7 +180,8 @@ SELECT pr.principal_id
180180FROM sys .database_principals AS pr
181181INNER JOIN sys .database_permissions AS pe ON pe .grantee_principal_id = pr .principal_id
182182INNER JOIN sys .objects AS o ON pe .major_id = o .object_id
183- INNER JOIN sys .schemas AS s ON o .schema_id = s .schema_id ;
183+ INNER JOIN sys .schemas AS s ON o .schema_id = s .schema_id
184+ WHERE pe .class = 1 ;
184185```
185186
186187### C. List permissions for a specific object
@@ -207,7 +208,8 @@ FROM sys.database_principals AS pr
207208INNER JOIN sys .database_permissions AS pe ON pe .grantee_principal_id = pr .principal_id
208209INNER JOIN sys .objects AS o ON pe .major_id = o .object_id
209210INNER JOIN sys .schemas AS s ON o .schema_id = s .schema_id
210- WHERE o .name = ' vAssocSeqOrders'
211+ WHERE pe .class = 1
212+ AND o .name = ' vAssocSeqOrders'
211213 AND s .name = ' dbo' ;
212214```
213215
You can’t perform that action at this time.
0 commit comments