schemas vs owners vs users

打印 被阅读次数

Owner is the creater.
User is the user account under a certain db.
schema is a container for organizing the objects.
schemas vs users
dbo-- 1. db owner;  2. user account: dbo; 3. schema: dbo
dbo.tblPerson -- here dbo is referred as the 'SCHEMA dbo', not 'user dbo' or 'owner dbo'
pro of schema.tblxxx:
Since the objects are not tied to any user accounts, you do not have to worry about changing the owner of objects when an account is to be removed. Another advantage is that the schemas can be used to simplify managing permissions on tables and other objects. The schema has an owner, but the owner is not tied to the name. So, if an account owns a schema and the account must be removed from the database, the owner of the schema can be changed without breaking any code. If you do not wish to organize your database objects into schemas, the dbo schema is available.



登录后才可评论.