What is dbo in SQL Server?
I used to learn about SQL, especially MySQL. Then now my job requires me to understand Microsoft SQL Server (mssql). So I make these notes to guide me and others who want to transition to mssql. I usually summarized what I found and understood so far from browsing the internet.
My takeaways:
-
dbo
stands for DataBase Owner. -
We can't remove privileges from an object owner and we can't drop users from a database if they own objects in it.
-
schema
is a named container for database objects, which allows us to group objects into separate namespaces. Theschema
is the database object that owns the table. For example, the AdventureWorks sample database contains schemas for Production, Sales, and HumanResources.
-
The four-part naming syntax for referring to objects specifies the schema name.
Server.Database.DatabaseSchema.DatabaseObject
-
Schemas can be owned by any database principal and a single principal can own multiple schemas. Principals are entities that can request SQL Server resources.
-
Schemas that contain objects cannot be dropped. The following schemas cannot be dropped:
dbo
,guest
,sys
,INFORMATION_SCHEMA
. -
The
sys
andINFORMATION_SCHEMA
schemas are reserved for system objects. We cannot create objects in these schemas and we cannot drop them. -
The
dbo
schema is the default schema of every database for all users. By default, users created with theCREATE USER
Transact-SQL command havedbo
as their default schema. Thedbo
schema is owned by thedbo
user account.
-
For example, the name of a table called orders owned by
dbo
isdbo.orders
. If the table’s ownership is transferred to userabc
, the table will now be namedabc.orders
. -
Users who are assigned the
dbo
as default schema don't inherit the permissions of thedbo
user account. No permissions are inherited from a schema by users; schema permissions are inherited by the database objects contained in the schema. -
the
dbo
user account is not the same as thedb_owner
fixed database role and thedb_owner
fixed database role is not the same as the user account that is recorded as the owner of the database. -
The default schema for a user is solely used for object-reference in case the user omits the schema when querying objects. Users in the database will be able to access any object owned by
dbo
without specifying the owner as long as the user has appropriate permission.
原文:https://dev.to/ranggakd/what-is-dbo-in-sql-server-396k
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12707874/viewspace-2885839/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- What is an SQL relation?SQL
- sql serverSQLServer
- Moebius for SQL ServerSQLServer
- sql server 使用SQLServer
- SQL Server教程SQLServer
- SQL SERVER優化SQLServer優化
- Nodejs 操作 Sql ServerNodeJSSQLServer
- SQL Server 別名(as)SQLServer
- sql server遞迴SQLServer遞迴
- Sql server with as update用法SQLServer
- SQL Server下載SQLServer
- SQL Server Left joinSQLServer
- SQL Server SUBSTRING FunctionsSQLServerFunction
- SQL Server LEFT FunctionsSQLServerFunction
- SQL Server Unique ConstratintsSQLServer
- ms sql server排序SQLServer排序
- SQL Server 替換SQLServer
- SQL Server 2008中Analysis Services的新特性——深入SQL Server 2008SQLServer
- SQL Server資料庫恢復,SQL Server資料恢復,SQL Server資料誤刪除恢復工具SQLRescueSQLServer資料庫資料恢復
- Sql_server基本操作SQLServer
- SQL SERVER 2008安全配置SQLServer
- SQL SERVER實用技巧SQLServer
- Microsoft SQL Server, Error: 15128 ()ROSSQLServerError
- SQL Server Management Studio (SSMS)SQLServerSSM
- High Availability (HA) in SQL ServerAISQLServer
- docker sql server安裝DockerSQLServer
- SQL Server 的死鎖SQLServer
- SQL Server 2019下載SQLServer
- SQL-Server筆記SQLServer筆記
- SQL Server大量插入 JavaSQLServerJava
- sql server 2019安裝SQLServer
- SQL Server 索引結構SQLServer索引
- SQL Server 審計(Audit)SQLServer
- sql-server檢視SQLServer
- SQL Server 2022 RTM 最新累積更新:Cumulative Update #13 for SQL Server 2022 RTMSQLServer
- .sql檔案匯入到sql server中SQLServer
- SQL Server一次SQL調優案例SQLServer
- SQLServer 物件建立注意事項之dboSQLServer物件