Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jo Mixon 13 posts 83 karma points
    Mar 29, 2021 @ 20:47
    Jo Mixon
    0

    Changing Database Table Schema from dbo. v8.8

    Does anyone know how or if it's even possible to change the database table schema from dbo. to something else and map Umbraco 8.12 to point to this database instead of the dbo?

    To explain the issue I am having is our source control has become corrupt on our Umbraco and I just have the folder structure on the server to reference. So, I pulled down the Nuget Umbraco and how have a source but when I point to the database it creates all new tables with a different namespace then dbo. I just want it to go back to reading the dbo schema. I figured if I could make a local version Not point to the dbo. tables then I could make this one point to the correct database in that particular environment.

    Any information on this topic would be greatly appreciated as I have already spent a good amount of time researching this topic on my own and haven't seen anyone with this issue specifically before.

    Thanks ahead of time.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Mar 31, 2021 @ 20:29
    Huw Reddick
    0

    The dB schema is related to your SQL user that creates the tables and how the user is set up in SQL. Is your SQL user mapped as dbowner?

  • Jo Mixon 13 posts 83 karma points
    Mar 31, 2021 @ 20:36
    Jo Mixon
    0

    I pulled down a new project from Nuget and ran it locally from my machine so I do think it took my credentials from attached account was used because that's the schema it used to create the database tables. Would there possibly be a way to change this behavior and point my local project to the DBO tables already created there instead of it creating more tables?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Mar 31, 2021 @ 20:50
    Huw Reddick
    0

    Definitely sounds like the SQL user is not mapped as the dbowner which is why it is creating the tables with your username as the schema. You could try moving all the dbo tables to the correct the schema name it is using to create them. Check this post for a SQL script to generat some alter schema statements for all your tables.

    https://stackoverflow.com/questions/17571233/how-to-change-schema-of-all-tables-views-and-stored-procedures-in-mssql/17571234#17571234

    Or try setting your SQL user as the dbowner

  • Jo Mixon 13 posts 83 karma points
    Mar 31, 2021 @ 20:56
    Jo Mixon
    0

    I do now see what you are talking about. In my case I would have to host my application on the server and make sure the owner is the dbo.

    Appreciate you taking the time to respond and answer my questions.

Please Sign in or register to post replies

Write your reply to:

Draft