473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Retrieve a list of db roles from within T-SQL????

CxG
How do you retrieve a list of db roles from within T-SQL???

I can't find a sys table that returns a list of roles. sysobjects
does not list roles as a object type.

I found sp_helprole, but I can't get the sp to return it's output into
a cursor or variable.

Help??

Regards,
CxG
Jul 20 '05 #1
3 21178
What about

Exec sp_helprole
--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"CxG" <ch***********@lmco.com> wrote in message
news:35************************@posting.google.com ...
How do you retrieve a list of db roles from within T-SQL???

I can't find a sys table that returns a list of roles. sysobjects
does not list roles as a object type.

I found sp_helprole, but I can't get the sp to return it's output into
a cursor or variable.

Help??

Regards,
CxG

Jul 20 '05 #2
Sorry. Fingers faster than brain

If you look inside sp_helprole you can see the queries that this proc
executes

select 'RoleName' = name, 'RoleId' = uid, 'IsAppRole' = isapprole
from sysusers where issqlrole = 1 or isapprole = 1

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Allan Mitchell" <al***@no-spam.sqldts.com> wrote in message
news:40***********************@lovejoy.zen.co.uk.. .
What about

Exec sp_helprole
--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"CxG" <ch***********@lmco.com> wrote in message
news:35************************@posting.google.com ...
How do you retrieve a list of db roles from within T-SQL???

I can't find a sys table that returns a list of roles. sysobjects
does not list roles as a object type.

I found sp_helprole, but I can't get the sp to return it's output into
a cursor or variable.

Help??

Regards,
CxG


Jul 20 '05 #3
CxG wrote:
How do you retrieve a list of db roles from within T-SQL???

I can't find a sys table that returns a list of roles. sysobjects
does not list roles as a object type.

I found sp_helprole, but I can't get the sp to return it's output into
a cursor or variable.

Help??

Regards,
CxG


From looking at what sp_helprole does...

select 'RoleName' = name, 'RoleId' = uid, 'IsAppRole' = isapprole
from sysusers where issqlrole = 1 or isapprole = 1

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Emick | last post by:
I need a way either using active directory or otherwise in VB .NET (API's are fine) to retrieve the list of IP addresses and MAC addressses from our DHCP server here. I specifically need to do...
1
by: mathieu.malaterre | last post by:
Hello, I am trying to build an executable that link against python libraries. If I only link to python lib I get thoses errors(*). This machine is a gentoo AMD64. I installed python by doing...
0
by: Kathy | last post by:
I have written queries against the MSysObjects table in the past to retrieve a list of the queries within a database. In Access 2000, I want to expand that capability to query a list of query...
1
by: William Oliveri | last post by:
Hi all, I"ve been trying to retrieve the names of each selected items in a Datalist. So I've been trying to loop through each entry in the datalist to retrieve the name of each entry. I...
0
by: Brian Henry | last post by:
Since no one else knew how to do this I sat here all morning experimenting with this and this is what I came up with... Its an example of how to get a list of items back from a virtual mode list...
0
by: mgonzales3 | last post by:
i have used directorysearcher to retrieve user information. Can I do this for a folder(dfs folder) in active directory?
3
by: JimCinLA | last post by:
I use a place holder to load different user controls on an .aspx page. Let's call this default.aspx. Each user controls contains about a dozen different ASP.Net controls. My question is, how...
2
by: j-in-uk | last post by:
Can i get a list of sql databases by just connecting to the server programmatically string myConnString = "Integrated Security=SSPI;Initial Catalog={0};Data Source=" + serverName +";";...
10
by: erikcw | last post by:
Hi, I have a list of numbers each with a +/- margin of error. I need to identify which ones overlab each other. For example: 55 +/- 3 20 +/- 2 17 +/- 4 60 +/- 3
3
by: Yudesh | last post by:
Hi I need to ask something I am trying to retrieve a value from a string and I have noticed the following: Scenario: - I have retrieved lines from a file and need to read each line to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.