Re: not creating tables as dbo anymore ?

From: Allan Mitchell (allan@no-spam.sqldts.com)
Date: 03/05/03


From: "Allan Mitchell" <allan@no-spam.sqldts.com>
Date: Wed, 5 Mar 2003 15:18:20 -0000


Hello, Francis!

Read these in BOL

Database Owner (dbo)
CREATE TABLE

owner
Is the name of the user ID that owns the new table. owner must be an
existing user ID in the database specified by database_name. owner defaults
to the user ID associated with the login for the current connection in the
database specified in database_name. If the CREATE TABLE statement is
executed by a member of the sysadmin fixed server role, or a member of the
db_dbowner or db_ddladmin fixed database roles in the database specified by
database_name, owner can specify a user ID other than the one associated
with the login of the current connection. If the CREATE TABLE statement is
executed by a login associated with a user ID that has only create table
permissions, owner must specify the user ID associated with the current
login. Members of the sysadmin fixed server role, or logins aliased to the
dbo user are associated with the user ID dbo; therefore, tables created by
these users default to having dbo as the owner. Tables created by any logins
not in either of these two roles have owner default to the user ID
associated with the login.

--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
: I know it is possible because it was doing it before but
: something changed and I don't know what.
: I saw that there is a dbo user associated to the database.
: Can I associate my user to it ?
: Francis.
??>> -----Original Message-----
??>> Hello, Francis!
??>>
??>> Have the user create the table using CREATE TABLE
: dbo.TableName(...........
??>>
??>> --
??>>
??>> Allan Mitchell (Microsoft SQL Server MVP)
??>> MCSE,MCDBA
??>> www.SQLDTS.com
??>> I support PASS - the definitive, global community
??>> for SQL Server professionals - http://www.sqlpass.org
??>>
??>> : I have userA that has access to one database as
??>> : db_owner.
??>>
??>> : How come, when I create a table it is not owned by dbo ?
??>> : It creates the tables as userA.table ...
??>>
??>> : I don't understand. How can I setup the user so that it
??>> : will create objects as dbo ?
??>>
??>>      ---  Microsoft CDO for Windows 2000
??>>
      ---  Microsoft CDO for Windows 2000


Relevant Pages

  • Re: Accidentally dropped DBO from database
    ... That error is due to having databases where the owner (dbo) ... is mapped to a login that doesn't exist on the server. ... a user in the database" when using sp_changedbowner, ...
    (microsoft.public.sqlserver.security)
  • Re: Confused about dbo
    ... Make sure you understand the difference between login names and user names. ... 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)
  • Re: db_owner role in SQL 2k
    ... The owner of a database is a login, which is listed in the sysdatabases ... I try not to think of DBO as the Database Owner, but just as special, ... For anyone to use any database, their login name must have been given access ...
    (microsoft.public.sqlserver.programming)
  • Re: Login Name is missing
    ... Database ownership determines to login mapping for the 'dbo' user. ... > I see 'dbo' listed as the OWNER of all the tables. ...
    (microsoft.public.sqlserver.security)
  • Re: properties owner and users owner.
    ... 'dbo' is a special database user and must exist in every database. ... normally be the same login but can get out-of-sync in some situations, ... owner entries are synchronized: ...
    (microsoft.public.sqlserver.server)