DBILITY

sqlserver 사용자 권한 조회 본문

database/mssql

sqlserver 사용자 권한 조회

DBILITY 2024. 9. 27. 14:26
반응형
SELECT T1.[NAME] AS USER_NM
     , T3.[NAME] AS OBJECT_NM
     , T3.[TYPE_DESC]
     , T2.[PERMISSION_NAME]
     , T2.STATE_DESC
FROM sys.DATABASE_PRINCIPALS AS T1 WITH (NOLOCK)
         INNER JOIN sys.DATABASE_PERMISSIONS AS T2 WITH (NOLOCK)
                    ON T2.GRANTEE_PRINCIPAL_ID = T1.PRINCIPAL_ID
         INNER JOIN sys.OBJECTS AS T3 WITH (NOLOCK)
                    ON T3.[OBJECT_ID] = T2.MAJOR_ID
WHERE T1.[NAME] = N'userId'

 

반응형
Comments