Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When creating tables in SSMS, I've realized that if you execute the following statement:

CREATE TABLE [tableName];

the table will be created under your own schema (and not dbo). So in order to create it under the dbo schema, you'll need to explicitly say so, like this:

CREATE TABLE [dbo].[tableName];

Does anyone know of a way (eg. server-wide setting) so that when a table is created, the [dbo] part doesn't need to be specified?

share|improve this question

migrated from Mar 2 '12 at 18:55

This question came from our site for professional and enthusiast programmers.

Which version of SQL server? – KAJ Mar 2 '12 at 18:15
And why do you have a problem with explicitly specifying? – HLGEM Mar 2 '12 at 18:40

The schema that will be used when schema is omitted will be the default schema of the database user. Therefore, to have dbo schema have the created table without specifying, you'd have to set that database user's default schema to dbo.

Server-wide setting? I don't think so. But you could write a query to convert all database users in a particular database to their default schema changed to dbo if that's what you so choose.

share|improve this answer
@KAJ: SQL2008R2 – Chinesinho Mar 2 '12 at 18:21
But you can't set the default schema to dbo for Windows groups... – Chinesinho Mar 2 '12 at 18:21
@Chinesinho You can't set the default schema of any server principal. You're confusing server logins and database users. Database users contain default schemas. – Thomas Stringer Mar 2 '12 at 19:29
Setting the default schema for users mapped to Windows group logins isn't supported prior to SQL Server 2012. – db2 Oct 11 '13 at 14:31

Maybe this can help

USE [YourDBName]
share|improve this answer
but if user is in windows Authentication then it cannot set the default schema – user29261 Oct 11 '13 at 4:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.