Home > Archive > MS SQL Server > March 2006 > Query/test for db_owner role?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Query/test for db_owner role?
R Baker

2006-03-05, 8:23 pm

Is there a SQL query that can explicitly return the roles that the current
SQL user has been explicitly assigned? I'm trying to find out if the user
has been given the db_owner role (versus it being implied by the user being
an administrator).

Thanks!


Tibor Karaszi

2006-03-05, 8:23 pm

What version of SQL server?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"R Baker" <nospamx@nospamx.com> wrote in message news:%239MeR9VPGHA.3944@tk2msftngp13.phx.gbl...
> Is there a SQL query that can explicitly return the roles that the current
> SQL user has been explicitly assigned? I'm trying to find out if the user
> has been given the db_owner role (versus it being implied by the user being
> an administrator).
>
> Thanks!
>
>

Ben Nevarez

2006-03-05, 8:23 pm


Would this work for you?

sp_helprolemember 'db_owner'

Ben Nevarez, MCDBA, OCP
Database Administrator


"R Baker" wrote:

> Is there a SQL query that can explicitly return the roles that the current
> SQL user has been explicitly assigned? I'm trying to find out if the user
> has been given the db_owner role (versus it being implied by the user being
> an administrator).
>
> Thanks!
>
>
>

R Baker

2006-03-05, 8:23 pm

Yes, that might. I'll have to figure out how to process the result set using
the MFC CDatabase classes, but it seems doable.

Thanks.

"Ben Nevarez" < BenNevarez@discussio
ns.microsoft.com> wrote in message
news:33F82F3D-CDA3-4040-B160- 22E6D96B3D55@microso
ft.com...[color=darkred]
>
> Would this work for you?
>
> sp_helprolemember 'db_owner'
>
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
>
> "R Baker" wrote:
>


R Baker

2006-03-05, 8:23 pm

SQL 2000 or SQL 2005 (mainly SQL 2000 for now).

Thanks.

"Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai
l.nomail.com> wrote in
message news:erz8UAWPGHA.3576@TK2MSFTNGP15.phx.gbl...[color=darkred]
> What version of SQL server?
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www. solidqualitylearning
.com/

> Blog: http:// solidqualitylearning
.com/blogs/tibor/

>
>
> "R Baker" <nospamx@nospamx.com> wrote in message
> news:%239MeR9VPGHA.3944@tk2msftngp13.phx.gbl...


Tibor Karaszi

2006-03-05, 8:24 pm

It is only one resultset, so you would process it like any resultset (as if you were sending a
SELECT from your app, or executing your own stored procedure which returns a result set).

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"R Baker" <nospamx@nospamx.com> wrote in message news:eTB3u8WPGHA.3936@TK2MSFTNGP10.phx.gbl...
> Yes, that might. I'll have to figure out how to process the result set using the MFC CDatabase
> classes, but it seems doable.
>
> Thanks.
>
> "Ben Nevarez" < BenNevarez@discussio
ns.microsoft.com> wrote in message
> news:33F82F3D-CDA3-4040-B160- 22E6D96B3D55@microso
ft.com...
>
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com