SQL Server: how to check securables
Posted
by jrara
on Server Fault
See other posts from Server Fault
or by jrara
Published on 2010-03-11T11:26:31Z
Indexed on
2010/05/12
16:44 UTC
Read the original article
Hit count: 288
I would like to make a t-sql query to check which logins have 'view server state' permission in server type securables. How to achieve this?
This query from mssqltips don't show this:
http://www.mssqltips.com/tip.asp?tip=1718
SELECT prin.[name] [User], sec.state_desc + ' ' + sec.permission_name [Permission]
FROM [sys].[database_permissions] sec
JOIN [sys].[database_principals] prin
ON sec.[grantee_principal_id] = prin.[principal_id]
WHERE sec.class = 0
ORDER BY [User], [Permission];
© Server Fault or respective owner