how to check if user has system admin privileges in SQL Server 2008 R2
I have a application that should only allow access to users who are system admins on the db. What sql script or quer开发者_如何学Cy can I execute from the c# code that, given a username, can determine if he/she has system admin privileges system specs: sql2008R2 db, .net 2.0, c#
Use IS_SRVROLEMEMBER.
SELECT IS_SRVROLEMEMBER('sysadmin', 'YourLogin')
精彩评论