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;
}







1















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










share|improve this question




















  • 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















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










share|improve this question




















  • 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








1








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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














3 Answers
3






active

oldest

votes


















2














This can also be done using the T-SQL statement below:



ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]





share|improve this answer































    2














    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



    enter image description here






    share|improve this answer


























    • 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



















    1














    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.






    share|improve this answer



















    • 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












    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    2














    This can also be done using the T-SQL statement below:



    ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]





    share|improve this answer




























      2














      This can also be done using the T-SQL statement below:



      ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]





      share|improve this answer


























        2












        2








        2







        This can also be done using the T-SQL statement below:



        ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]





        share|improve this answer













        This can also be done using the T-SQL statement below:



        ALTER USER [DomainUserName] WITH DEFAULT_SCHEMA=[dbo]






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 18:18









        Hamed NaeemaeiHamed Naeemaei

        463410




        463410

























            2














            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



            enter image description here






            share|improve this answer


























            • 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
















            2














            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



            enter image description here






            share|improve this answer


























            • 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














            2












            2








            2







            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



            enter image description here






            share|improve this answer















            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



            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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



















            • 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











            1














            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.






            share|improve this answer



















            • 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














            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.






            share|improve this answer



















            • 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








            1







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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














            • 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


















            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Florida Star v. B. J. F.

            Error while running script in elastic search , gateway timeout

            Adding quotations to stringified JSON object values