Hi, i know that for non-sysadmin role members, non-qualified objects
will be owned by the creating user.
Is it possible to change this so that objects created by users
belonging to database role 'db_owner' default to dbo?
Thanks,
RafetJust have the CREATE statement use dbo as the schema.
create table dbo.test
Randy Dyess
www.Database-Security.Info|||Not really. You could use sp_addalias but it's not
recommended to go this route and sp_addalias is provided for
backwards compatibility only.
Members of db_owner should qualify the objects they are
creating with dbo. It's considered good practice to always
qualify objects with the owner name - when creating or
referencing objects. Qualifying objects improves performance
and readability.
-Sue
On 5 Mar 2004 07:16:48 -0800, rducic@.hotmail.com (Rafet)
wrote:
>Hi, i know that for non-sysadmin role members, non-qualified objects
>will be owned by the creating user.
>Is it possible to change this so that objects created by users
>belonging to database role 'db_owner' default to dbo?
>Thanks,
>Rafet|||I am puzzled about this too. I am about to start using sp_addalias though.
I think Microsoft needs to think this area through a little better. I know
sp_addalias may go away some day, but the current version doesn't handle thi
s well.
In test, we like to give developers logins that link to the dbo user so that
we can have the system enforce all objects getting created by dbo. Then wh
en we create these in production we can be comfortable that the user is the
same and any code that refe
rences the user will always be "dbo" and not "joe_developer".
While it is best practice for developers to always reference user name with
objects, in practice it is harder to enforce without the system to do it for
us. Our company employs consultants regularly and they all seem to have di
fferent habits we end up ha
ving to work on with them.
Saturday, February 25, 2012
defaulting newly created objects to DBO
Labels:
created,
creating,
database,
dbo,
defaulting,
members,
microsoft,
mysql,
newly,
non-qualified,
non-sysadmin,
objects,
objectswill,
oracle,
owned,
role,
server,
sql,
user
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment