Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Invalid object name


Invalid object name

Author
Message
jere42
jere42
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 75
We originally set up our database so that some of the tables were owned by dbo and the rest by another user (call it SYS/username for this example). All was fine and I wrote several views and stored procedures. When I learned enough to know that they should all be dbo, I had the administrator change all the tables to be owned by dbo. Now all SPROCS , tables, and views are owned by dbo. Good. Now any time I try to run anything (SPROC or view) I always get a variation on this error (it only changes by the name of the object I tried to execute/access)…

[Microsoft][ODBC SQL Server Driver][SQL Server] Invalid object name ‘SYS\username.tbl0010CallDetail’.

I had removed all traces of SYS\username references in the code of the objects but it is still imbedded.
Is there an easy way to tell SQL Server to rebuild using the new code so that the SYS\username references go away? Is it possible that the SPROC is not being run by dbo but actually SYS\username when run out of Query Analyzer (the name of all SPROCS are qualified with [dbo]).

Help!



Greg Larsen
Greg Larsen
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1051 Visits: 290
Possibly your stored procedures are still in cache. You might try SP_RECOMPILE on all SP. Seems like there is an easy way flush all execution plans from cache, but I just can't recall how to do that right now.

Gregory Larsen, DBA

If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

Gregory A. Larsen, MVP
Rodrigo Acosta
Rodrigo Acosta
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1595 Visits: 21
also add in all the procedures the dbo. when calling to any object.
For example:
SELECT * FROM dbo.TableName
EXEC dbo.spname



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search