Link to home
Start Free TrialLog in
Avatar of justjuice
justjuice

asked on

Error 208: Invalid Object Name after moving database

Hi. Apologies in advance if my description of this problem is a little basic - I'm no DBA!

I have restored a database backup on a local machine. I then had to create a new login to match the owner of this restored database's objects. I then sorted out this orhpaned user with "sp_change_users_login. Everything is fine in terms of the web application logging into this database correctly as this user and accessing the various objects.

However, when it comes to changing views or stored procedures, I get Error 208 message relating to the tables used in the views and stored procedures. If I prefix the table names with the owning user name, it is ok. I am not sure why this is necessary, as the owner of the tables, views, and stored procedures are the same. Unfortunately, I do not have the liberty of adding prefixes in all the views, etc as this is not my database and I am just adding extra features to the associated web application.

Can anyone suggest a way of making changes to views and stored procedures that will not require adding the owner prefix to the objects. It obviously works ok on their development and live servers, is there something I have missed in my setup?

Thanks.
Avatar of Aneesh
Aneesh
Flag of Canada image

I think it is better to set the owner of all the database as 'dbo'
Avatar of justjuice
justjuice

ASKER

Thanks for the response, unfortunately I do not have the flexibility to change object owners as it is not my database.
justjuice,
> Unfortunately, I do not have the liberty of adding prefixes in all the
> views, etc as this is not my database
without the create / alter view permission, it is not possible
I'm not sure what you mean. I am attempting to make these changes as dbo - which has permissions for everything.
I figured it out. I needed to log into Query Analyser as the object owner to make the changes. How do you close this topic?
No objections from me.. PAQ it
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial