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?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh RetnakaranDatabase AdministratorCommented:
I think it is better to set the owner of all the database as 'dbo'
justjuiceAuthor Commented:
Thanks for the response, unfortunately I do not have the flexibility to change object owners as it is not my database.
Aneesh RetnakaranDatabase AdministratorCommented:
> 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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

justjuiceAuthor Commented:
I'm not sure what you mean. I am attempting to make these changes as dbo - which has permissions for everything.
justjuiceAuthor Commented:
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?
Aneesh RetnakaranDatabase AdministratorCommented:
Aneesh RetnakaranDatabase AdministratorCommented:
No objections from me.. PAQ it
PAQ-ing the question and refunding 500 points

Thanks aneeshattingal

The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.