Solved

Get the Roles the actual user has in a SQL database

Posted on 2009-05-18
2
296 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now