Re: Getting username



> For short time I've been added to sysadmin group
>
> From now on when i create new database it get DB owner

I don't understand your question. The expected behavior is that the
database will be owned by your login when you create the database. You can
change the database owner after creation using sp_changedbowner.

> And when use SELECT User i still get my name and not dbo.

Sysadmin role members are mapped to the 'dbo' user in all databases so this
will return 'dbo'. You can retrieve the current login using SELECT
SUSER_SNAME().

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Roy Goldhammer" <roy@xxxxxxxxxxx> wrote in message
news:%23UT5BZLBGHA.3064@xxxxxxxxxxxxxxxxxxxxxxx
> Hello there
>
> For short time I've been added to sysadmin group
>
> From now on when i create new database it get DB owner
>
> And when use SELECT User i still get my name and not dbo.
>
> That is fine. The question is how can i do that?
>
>


.



Relevant Pages

  • Re: not creating tables as dbo anymore ?
    ... Database Owner (dbo) ... existing user ID in the database specified by database_name. ... with the login of the current connection. ...
    (microsoft.public.sqlserver.security)
  • Re: Change UDF Owner
    ... Does it exist in the master database? ... Users can be put in the dbo role, but dbo will still own objects ... concept of 'schema' as 'owner' rather than just schema as DDL is exploited ... to the appropriate Fixed Server Roles or whatever is applicable. ...
    (microsoft.public.sqlserver.security)
  • Re: Change UDF Owner
    ... system_function_schema -especially in the master database. ... Most good judgment comes from experience. ... dbo is in the context of a database, and can be the schema owner for the ... Users can be put in the dbo role, ...
    (microsoft.public.sqlserver.security)
  • Re: conflicting object names in sql server 2000
    ... On the local database server when it does the select * from ... > michael.xxx Note that michael is the owner of the database. ... it will see if there is one owned by dbo. ...
    (microsoft.public.sqlserver.server)
  • Re: Confused about dbo
    ... Jasper Smith (SQL Server MVP) ... > database within a SQL Server instance. ... > There are several ways you could have the username dbo. ... > the true owner of the database. ...
    (microsoft.public.sqlserver.security)