473,395 Members | 1,379 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,395 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 21179
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.