Groups for dbo

From: Robert Morley (rmorley_at_magma.ca)
Date: 06/03/05


Date: Fri, 3 Jun 2005 14:01:50 -0400

Hi everyone,

I'm still fairly new to SQL Server, and I'm trying to figure something out:
When I log on to SQL Server with Integrated Security (SSPI), it figures out
that I'm actually the database owner and logs me in as dbo instead (i.e.,
user_name = 'dbo'; suser_sname = '<our domain>\robert.morley').

Under our current settings, that make no difference to me whatsoever, but
looking ahead, I'm wondering about code like the following:

    IF Is_Member ('My Group Name') SET SomeFlag = 1

It would seem that you can't change the group membership for dbo, so if you
have a custom group, Is_Member() always returns 0.

I can see a couple of ways to work around this problem (changing the
database owner to some other account, creating a SQL Login just for me and
using that, etc.), but they all seem kinda messy solutions. Does anybody
have any other suggestions as to how to work around this problem? If I
could get SQL Server to not map my login to dbo, that would be the ideal
solution, but adding dbo to groups would be sufficient as well.

If changing the database owner is the best way to do that, which I don't
terribly like but it'll do, then how do I go about doing that? I can
probably find it in the docs somehwere, but I don't think I know how
off-hand.

Thanks,
Rob



Relevant Pages

  • Re: DBO Best Practices
    ... lines of always owner qualifying objects... ... someone who are just "a" dbo. ... > doesn't explicitly reference the object's owner (because SQL Server will ... The startup account defines the ...
    (microsoft.public.sqlserver.security)
  • Re: DBO Best Practices
    ... If you let DBO own databases or objects then regular ... Please note that the DBO user is identified by the SQL Server process ... the SQL Server startup account (for the ... SQL Server process) controls SQL Server's ability to work with NT's objects ...
    (microsoft.public.sqlserver.security)
  • Re: Will anyone know this?
    ... You can determine if your login is the database owner with sp_helpdb. ... The only required user in a SQL Server database is dbo and this special ...
    (microsoft.public.sqlserver.security)
  • Re: ASP.net insists on using dbo. to call aspnet_* stored procedures
    ... No. mysql_login is one account and the dbo is another account, ... SQL Server 2000 developer in same machine. ... connection string is setup to use the sql login assigned to the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.net insists on using dbo. to call aspnet_* stored procedures
    ... dbo is the schema used in SQL Server and, even if removed from queries, is technically still there. ... It sounds more like a permissions error or connectivity problem than a dbo problem. ... Is SQL Server on the same box as your application? ... the remote server once again, but I still get errors like this: ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast