Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

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


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]).


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: Wednesday, August 17, 2016 10:41 PM
Points: 1,043, 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

Gregory A. Larsen, MVP
Post #62178
Posted Tuesday, May 13, 2003 10:06 AM



Group: General Forum Members
Last Login: 2 days ago @ 10:50 AM
Points: 1,582, Visits: 11
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