Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Invalid object name Expand / Collapse
Author
Message
Posted Tuesday, May 13, 2003 9:17 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, February 16, 2011 1:03 PM
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!





Post #12153
Posted Tuesday, May 13, 2003 9:57 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, June 6, 2014 2:06 PM
Points: 1,040, Visits: 277
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

Need SQL Server Examples check out my website at http://www.sqlserverexamples.com
Post #62178
Posted Tuesday, May 13, 2003 10:06 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 4:43 PM
Points: 1,581, Visits: 6
also add in all the procedures the dbo. when calling to any object.
For example:
SELECT * FROM dbo.TableName
EXEC dbo.spname




Post #62179
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse