Error 208: Invalid Object Name after moving database
Posted on 2006-04-25
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?