Solved

Get the Roles the actual user has in a SQL database

Posted on 2009-05-18
2
313 Views
Last Modified: 2012-05-07
Hello,
In a C# program, I'm seeking to find a way to determine which roles the actual user (the one with I am connected to the database) has.

I know taht this command will tell me the name of the actual user : "SELECT SUSER_SNAME()".

... but now I wnat to know what are its roles in the database, is it possible ?
0
Comment
Question by:Bulle
  • 2
2 Comments
 
LVL 5

Expert Comment

by:dhobale
ID: 24413278
try the following stored procedure:

sp_helpsrvrole [[@srvrolename =] 'role']
0
 
LVL 5

Accepted Solution

by:
dhobale earned 500 total points
ID: 24413282
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question