2

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
)
Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233

2 Answers2

3

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]

More on S.O.

Community
  • 1
  • 1
razethestray
  • 666
  • 1
  • 9
  • 20
1

"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

Community
  • 1
  • 1
pjwilliams
  • 300
  • 2
  • 10