Version: MS-SQL 2017
1 2 3 4 5 6 7 8 9 10 | DECLARE @GranteeName NVARCHAR(50) = N'username' ,@PermissionType CHAR(2) = '' ,@ObjectType CHAR(2) = '' SELECT SCHEMA_NAME(o.schema_id) + '.' + o.name AS ObjectName FROM sys.objects AS o LEFT JOIN sys.database_permissions AS dp ON o.object_id = dp.major_id AND dp.type = @PermissionType LEFT JOIN sys.database_principals AS dpr ON dp.grantee_principal_id = dpr.principal_id AND dpr.name = @GranteeName WHERE o.type = @ObjectType AND dpr.name IS NULL |
댓글 없음:
댓글 쓰기