开发者

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')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜