I have a application that should only allow access to users who are system admins on the db. What sql script or query 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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With