Reputation: 21136
When I go to create a new Table, I'm aware that I can do something like:
CREATE TABLE Users
(
[Id] INT NOT NULL PRIMARY KEY
)
But what does the [dbo]. part mean in the following example:
CREATE TABLE [dbo].[Table]
(
[Id] INT NOT NULL PRIMARY KEY
)
Upvotes: 3
Views: 26452
Reputation: 288
"dbo" is a special schema, it is the database-owner. It exists in every database, but you can add schemas (like folders) to databases
From: https://stackoverflow.com/a/4824493/677480
Upvotes: 1
Reputation: 676
That is the Schema that the table is being placed in. This is not actually required as dbo is the default schema and any objects referenced without schema specified are assumed to be in dbo.
If you were to create your own schema eg:
CREATE SCHEMA [MySchema] AUTHORIZATION [dbo]
You would then have to reference any objects in it as [MySchema].[MyObject]
Upvotes: 4