SQL server

Change default schema for a user.

[SQL 2005]. When a schema is not specified for a user, dbo is chose. If you wish to change this, use the query below:

ALTER USER user_name WITH DEFAULT_SCHEMA = schema_name;

Chances are that schema_name might not exist, so this will have to be created first. I have noticed that using the GUI will not change the default schema from dbo, hence the need for the TSQL above.


Thinking about someting? Leave a Reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s