Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

SQL Server table owners question

  • 27-03-2014 10:16AM
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    I'm moving a website to different hosting for a client. It uses classic ASP and SQL Server.

    I created a user u1023117_d. Selecting from tables prefixed with dbo. works fine but some tables are prefixed with d_ie. and i cannot select from these unless i include the d_ie. prefix
    select * from table (that's named dbo.table) works fine
    

    But
    select * from table2 (that's named d_ie.table) does not work (Invalid object name 'table2')
    

    The problem is that all the code uses select statements directly in the code without any table prefix. The old user was d_ie so tables prefixed with this were working when selected without the prefix.

    Does anyone know how i can set the database so my new user can call all tables irrespective of their prefix. I'm on shared hosting so my permissions might be limited.

    Thanks in advance


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    You could try the grant schema option. http://technet.microsoft.com/en-us/library/ms187940(v=sql.105).aspx

    Why did you go the Schema route?


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    Thanks.

    It's a database from some eCommerce solution and looks like it's been tweaked over the years. I have not been involved in the development of the database or website.

    Ill check out the link


  • Closed Accounts Posts: 5,361 ✭✭✭Boskowski


    Can the tables be moved to dbo? It is seldom a good idea to have tables or any other SQL objects for that matter in a user schema.


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    Thanks, i managed to setup a copy locally, transfer all the non dbo tables back to dbo by using the alter schema command.

    Cheers


Advertisement