How to change the owner of a SQL Server table from domainusername to dbo?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
When I create a table, the owner is always domainusername instead of dbo. For example, domainusername.tablename I know how how to change it to dbo but what should I change in the configuration level to make sure that when I create a table, the default owner is dbo. like dbo.tablename ?
Thanks
sql-server dbo
add a comment |
When I create a table, the owner is always domainusername instead of dbo. For example, domainusername.tablename I know how how to change it to dbo but what should I change in the configuration level to make sure that when I create a table, the default owner is dbo. like dbo.tablename ?
Thanks
sql-server dbo
1
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
1
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
1
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40
add a comment |
When I create a table, the owner is always domainusername instead of dbo. For example, domainusername.tablename I know how how to change it to dbo but what should I change in the configuration level to make sure that when I create a table, the default owner is dbo. like dbo.tablename ?
Thanks
sql-server dbo
When I create a table, the owner is always domainusername instead of dbo. For example, domainusername.tablename I know how how to change it to dbo but what should I change in the configuration level to make sure that when I create a table, the default owner is dbo. like dbo.tablename ?
Thanks
sql-server dbo
sql-server dbo
edited Nov 16 '18 at 18:12
marc_s
585k13011261272
585k13011261272
asked Nov 16 '18 at 18:09
Joie TamayoJoie Tamayo
1911415
1911415
1
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
1
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
1
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40
add a comment |
1
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
1
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
1
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40
1
1
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
1
1
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
1
1
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40
add a comment |
3 Answers
3
active
oldest
votes
This can also be done using the T-SQL statement below:
ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]
add a comment |
You can change the DEFAULT SCHEMA
via the Object Explorer
Security > Users > {Your User}
{right-click} > Properties
Then on the General Tab set Default schema
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
add a comment |
Follow this steps:
- In the Object Explorer, expand your database node, go to "Security" folder and expend that node too.
- You will see "Users" folder, expend that node too to see the users.
- Right click on your user
- Click propertise from the menu appears.
- In general tab, you will see "Default Schema", click on the button "..." on the right
- Select "dbo" schema and click "OK" button.
Now, try to create a new table.
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343245%2fhow-to-change-the-owner-of-a-sql-server-table-from-domain-username-to-dbo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
This can also be done using the T-SQL statement below:
ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]
add a comment |
This can also be done using the T-SQL statement below:
ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]
add a comment |
This can also be done using the T-SQL statement below:
ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]
This can also be done using the T-SQL statement below:
ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]
answered Nov 16 '18 at 18:18
Hamed NaeemaeiHamed Naeemaei
463410
463410
add a comment |
add a comment |
You can change the DEFAULT SCHEMA
via the Object Explorer
Security > Users > {Your User}
{right-click} > Properties
Then on the General Tab set Default schema
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
add a comment |
You can change the DEFAULT SCHEMA
via the Object Explorer
Security > Users > {Your User}
{right-click} > Properties
Then on the General Tab set Default schema
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
add a comment |
You can change the DEFAULT SCHEMA
via the Object Explorer
Security > Users > {Your User}
{right-click} > Properties
Then on the General Tab set Default schema
You can change the DEFAULT SCHEMA
via the Object Explorer
Security > Users > {Your User}
{right-click} > Properties
Then on the General Tab set Default schema
edited Nov 16 '18 at 18:26
answered Nov 16 '18 at 18:17
John CappellettiJohn Cappelletti
47.4k62647
47.4k62647
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
add a comment |
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
Hi John, I tried that but the dbo remains the default. Do i need to start the SQL server ? Thanks
– Joie Tamayo
Nov 16 '18 at 18:27
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo Should not be necessary
– John Cappelletti
Nov 16 '18 at 18:45
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
@JoieTamayo It dawned on me that may be expecting already created tables to be renamed to dbo. Do as above, any new table would be dbo. Then to change existing take a peek at docs.microsoft.com/en-us/sql/t-sql/statements/…
– John Cappelletti
Nov 16 '18 at 19:32
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
Yes, but I would like to change the default. Thanks
– Joie Tamayo
Nov 16 '18 at 19:45
add a comment |
Follow this steps:
- In the Object Explorer, expand your database node, go to "Security" folder and expend that node too.
- You will see "Users" folder, expend that node too to see the users.
- Right click on your user
- Click propertise from the menu appears.
- In general tab, you will see "Default Schema", click on the button "..." on the right
- Select "dbo" schema and click "OK" button.
Now, try to create a new table.
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
add a comment |
Follow this steps:
- In the Object Explorer, expand your database node, go to "Security" folder and expend that node too.
- You will see "Users" folder, expend that node too to see the users.
- Right click on your user
- Click propertise from the menu appears.
- In general tab, you will see "Default Schema", click on the button "..." on the right
- Select "dbo" schema and click "OK" button.
Now, try to create a new table.
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
add a comment |
Follow this steps:
- In the Object Explorer, expand your database node, go to "Security" folder and expend that node too.
- You will see "Users" folder, expend that node too to see the users.
- Right click on your user
- Click propertise from the menu appears.
- In general tab, you will see "Default Schema", click on the button "..." on the right
- Select "dbo" schema and click "OK" button.
Now, try to create a new table.
Follow this steps:
- In the Object Explorer, expand your database node, go to "Security" folder and expend that node too.
- You will see "Users" folder, expend that node too to see the users.
- Right click on your user
- Click propertise from the menu appears.
- In general tab, you will see "Default Schema", click on the button "..." on the right
- Select "dbo" schema and click "OK" button.
Now, try to create a new table.
answered Nov 16 '18 at 18:45
SamiSami
9,40331244
9,40331244
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
add a comment |
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
1
1
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
Hi Sami, that's what i did and it's always dbo. Thanks
– Joie Tamayo
Nov 16 '18 at 19:42
1
1
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
@JoieTamayo Please read this
– Sami
Nov 16 '18 at 19:56
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53343245%2fhow-to-change-the-owner-of-a-sql-server-table-from-domain-username-to-dbo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
When you create the table append the dbo in front of it like this: Create Table.. dbo.TableName
– Brad
Nov 16 '18 at 18:14
1
Did you try to set the default schema for that user?
– Sami
Nov 16 '18 at 18:24
1
If you specify the schema (which you really should be when referencing objects) this problem disappears.
– Larnu
Nov 16 '18 at 18:40