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.
Tell me more
×
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. It's 100% free, no registration required.
migrated from stackoverflow.com Jan 22 '12 at 12:56
|
In SSMS go to your database user and click on properties. You will see a field there for default schema. T-SQL version:
|
|||
|
|
|
Your manager is a member of the If you want to change ownership after the table has been created, use |
|||
|
|
|
How are you creating the table? By running a SQL script, or in the SQL Server Management Studio GUI? When you use a SQL script, you can specify the schema in the script:
or
|
|||
|
|
|
You can find the default schema for a user by looking in the sys.database_principals system view. As to "renaming" it (i.e. moving it to another schema), try:
|
|||
|
|