Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Error 208: Invalid Object Name after moving database

Posted on 2006-04-25
9
Medium Priority
?
268 Views
Last Modified: 2010-08-05
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.
0
Comment
Question by:justjuice
  • 4
  • 3
8 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16535914
I think it is better to set the owner of all the database as 'dbo'
0
 
LVL 1

Author Comment

by:justjuice
ID: 16536118
Thanks for the response, unfortunately I do not have the flexibility to change object owners as it is not my database.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16536419
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
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 1

Author Comment

by:justjuice
ID: 16536612
I'm not sure what you mean. I am attempting to make these changes as dbo - which has permissions for everything.
0
 
LVL 1

Author Comment

by:justjuice
ID: 16538427
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?
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16541519
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16555767
No objections from me.. PAQ it
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16556342
PAQ-ing the question and refunding 500 points

Thanks aneeshattingal

GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question