"Database Learning Notes" What is dbo?

Source: Internet
Author: User

The first use of SQL Server is not very understanding of dbo. Search the Internet for some other people's understanding, now excerpt as follows.

Source URL:

http://bbs.csdn.net/topics/200051355

http://bbs.csdn.net/topics/100179549

I also on Baidu to find a bit, there are two murders more like.

1. The dbo is a schema, and in sql2005, the table is called in the following format: "database name. Schema name", the same user can be authorized to access multiple architectures, or can be banned from accessing one or more architectures, which is the concept of "user-to-architecture separation" advocated in 2005 . In 2005, if the schema was not specified when the table was created, the system default schema for the table is dbo, so many table names are automatically added before the dbo. Character style.
2. DBO is the default user for each database, with owner permissions, that is, Dbowner


These two answers, it seems to be roughly the same, but there are obvious differences, it is a headache, hope that the SQL has many years of understanding of the predecessors to explain or the next conclusion, in the end is "framework" or "Default User"?

--------------------------------------------------------------------------------------------------------------- ------------

The dbo is the default user and the schema,
dbo as the schema is for better compatibility with 2000,
In 2000, DataBaseName.dbo.TableName is interpreted as: database name, user name, table name,
In 2005, DataBaseName.dbo.TableName is interpreted as: database name. Schema name. Table name,
In this way, the code in 2000 is migrated to 2005 without an error (the DBO is the default schema in 2005, and if you do not specify a schema when you create the table, the default is the DBO schema).

--------------------------------------------------------------------------------------------------------------- -------------------

Although  SQL Server 2000  contains  CREATE SCHEMA  statements, But it doesn't actually create the schema as defined above. In  SQL Server 2000 , database users and schemas are implicitly connected. Each database user is the owner of the schema with the same name as the user. The owner of the object is functionally the same as the schema owner that contains it. Thus the "schema" of the fully qualified name in,sql server 2000  is also a user in the database.

in  SQL Server 2005 , schemas exist independently of the database user who created them. You can transfer ownership of a schema without changing the schema name. You can also create an object with a user-friendly name in the schema that explicitly indicates the functionality of the object. The

sql server 2005  also introduces the concept of "default schema", which resolves the names of objects that are not referenced with their fully qualified names. In  SQL Server 2000 , the first thing to check is the schema that is owned by the calling database user, and then the  DBO  owned schema. In  SQL Server 2005 , each user has a default schema that specifies the first schema that the server will search for when resolving the name of the object. You can set and change the default schema by using  DEFAULT_SCHEMA  options for  CREATE USER  and  ALTER USER . If  default_schema is not defined, the database user will use  DBO  as its default schema.

--------------------------------------------------------------------------------------------------------------- --------------------

"Database Learning Notes" What is dbo?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.