title: What is the difference between "db_owner" and "the user that owns the database" in SQL Server 2000?
body: <p>I'm trying to better understand why one of our database update scripts failed to work properly at a particular customer site, and narrowed it down (I think) to database ownership and roles. </p>
  
  <blockquote>
    <p><strong>Disclaimer:</strong> I'm actually waiting to hear back from the customer's DBA so they can tell us if they upgraded their SQL database recently and so we can look at their database. I'm thinking a SQL 2000 to SQL 2005 conversion might have hosed our scripts if our applications's database login was converted to a schema, because we were referencing <code>dbo</code> in a few places in the update script.</p>
  </blockquote>
  
  <p>Anyway, I've been trying to find a better explanation of database ownership and roles and how it impacts what owner a database object is actually assigned when you don't explicitly specify the owner in a T-SQL statement. For example, our update scripts typically just do <code>CREATE TABLE foo</code> instead of <code>CREATE TABLE dbo.foo</code> or something else, but I found a few that were explicitly using <code>dbo</code>, and those are the ones causing problems at the moment (only for this one customer).</p>
  
  <p>I found <a href="http://www.sqlservercentral.com/articles/Advanced/understandingobjectownership/1966/" rel="noreferrer">this article</a> (specific to SQL Server 2000), but the table on that page is confusing. It mentions <code>db_owner</code> and "owns the database" as two distinct possibilities for what role a user can have.</p>
  
  <p>For example, the table states that if a user <code>sam</code>, who is in the <code>db_owner</code> role, runs the query <code>CREATE TABLE [test3](abc int)</code>, it will be owned by <code>sam</code>.</p>
  
  <p>It then mentions that if a another user <code>sue</code>, who "<em>owns the database</em>" (sic), runs the same query, it will be owned by <code>dbo</code>.</p>
  
  <p>Wouldn't <code>db_owner</code> and "owns the database" be the same thing? The table implies that there is a difference between "being in the <code>db_owner</code> role" and actually "being the owner of the database." But, if that's, true, what does it mean to "own the database" if it's something other than being a member of the <code>db_owner</code> role?</p>