HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

What determines the default schema name in SQL Server?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thewhatsqldeterminesdefaultnameserverschema

Problem

when I tried to create a table, it is using my ID as the schema name. But when the table is created on my manager's computer, the schema name is "dbo". Why? He might have administrator rights. When I tried to rename by using sp_rename, it is not changing.

Solution

In SSMS go to your database user and click on properties. You will see a field there for default schema.

T-SQL version:

alter user YourDbUser 
with default_schema = YourNewSchema

Code Snippets

alter user YourDbUser 
with default_schema = YourNewSchema

Context

StackExchange Database Administrators Q#11275, answer score: 7

Revisions (0)

No revisions yet.