What is the difference between "db_owner" and "the user that owns the database" in SQL Server 2000? -


i'm trying better understand why 1 of our database update scripts failed work @ particular customer site, , narrowed down (i think) database ownership , roles.

disclaimer: i'm waiting hear customer's dba can tell if upgraded sql database , can @ database. i'm thinking sql 2000 sql 2005 conversion might have hosed our scripts if our applications's database login converted schema, because referencing dbo in few places in update script.

anyway, i've been trying find better explanation of database ownership , roles , how impacts owner database object assigned when don't explicitly specify owner in t-sql statement. example, our update scripts typically create table foo instead of create table dbo.foo or else, found few explicitly using dbo, , ones causing problems @ moment (only 1 customer).

i found this article (specific sql server 2000), table on page confusing. mentions db_owner , "owns database" 2 distinct possibilities role user can have.

for example, table states if user sam, in db_owner role, runs query create table [test3](abc int), owned sam.

it mentions if user sue, "owns database" (sic), runs same query, owned dbo.

wouldn't db_owner , "owns database" same thing? table implies there difference between "being in db_owner role" , "being owner of database." but, if that's, true, mean "own database" if it's other being member of db_owner role?

no, db_owner , owner of database not same. dbo user , db_owner database role. databases owned logins. whatever login owns database aliased dbo inside database. can change database owner using sp_changedbowner system stored procedure.

all objects in database owned user. users members of db_owner role, among other permissions, allowed create objects owned dbo. if user not member of db_owner, has create permissions (e.g. create table), objects create owned user created them. can change ownership of object using sp_changeobjectowner system stored procedure.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -