I've been trying to figure out why SQL Server has db_owner schema and db_owner role? This is very confusing. I've been searching for answers and so far this is how my understanding goes:
- All tables and objects (such as constraints etc) belong to a schema. DBO being the default schema.
- A user may be given permission to edit each object or the schema. A permission on the schema extends the permission to all objects within that schema. So you don't have to grant permission on each individual object.
- A role groups permissions together for convenience.
If any of this is incorrect let me know. But I think so far so good. Now my questions are:
- What exactly is 'db_owner' schema as seen in "Database User" dialog box of sql server management studio? And on the same dialog you define the "Default Schema" as dbo. Why aren't the two the same? If by default SQL Server uses dbo to create all objects under, what use is db_owner?
- Why would a user want to own a schema? You are assigning permissions/roles already. What does owning db_accessadmin give you?
- Can you give an example of when you create objects under db_owner schema and db_accessadmin schema? In other words does anyone legitimetly use those schemas?
Thanks for your help.