笔记151 判断登录用户是否是sysadmin角色
笔记151 判断登录用户是否是sysadmin角色
1 --判断登录用户是否是sysadmin角色 2 SELECT name,Sid,type_desc, 3 IS_SRVROLEMEMBER('sysadmin', name) AS IsSysAdmin 4 FROM sys.server_principals p 5 where name='JOE\Administrator' 6 7 8 SELECT name,Sid,type_desc, 9 IS_SRVROLEMEMBER('sysadmin', name) AS IsSysAdmin 10 FROM sys.server_principals p 11 where name='sa'