May 13, 2007 at 10:24 am
hi guys i'm constantly getting this error message when running a SP,
Invalid object name 'dbo.Patient_Dem2'
even though this object is spelt correctly and is in the database
any thoughts?
thx
May 13, 2007 at 11:09 am
Does the user that you're logged in as have permissions to that object?
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgMay 14, 2007 at 12:49 pm
What type of object is Patient_Dem2? Table or stored procedure?
What do you get when you run the following query:
SELECT t.uid
, t.[name] As ObjName
, u.[name] AS UserName
FROM sysobjects t
JOIN sysusers u ON t.uid = u.uid
WHERE t.[name] = 'Patient_Dem2'
May 15, 2007 at 12:57 am
It probably exists as a different owner than dbo such as: mylogin.Patient_Dem2
May 15, 2007 at 5:30 am
From the error message, I appears that Patient_Dem2 is a table (or a table-valued user-defined function). Assuming a table, three things come to mind:
1. The database context is wrong.
2. The object was dropped.
3. A bug in the stored procedure.
The best way for others to help solve this is to post the code for the stored procedure.
By the way, if you've figured this out on your own, please post a quick message here to let us know.
May 15, 2007 at 5:37 am
The error may also come from a trigger (assuming this may not be a select statement).
May 16, 2007 at 6:58 am
Hi,
did you try to call 'dbo.[Patient_Dem2]' instead of 'dbo.Patient_Dem2' ?
regards
karl
Best regards
karl
May 16, 2007 at 11:20 am
thx guys i got this prob resolved
thx much for the replies
May 16, 2007 at 1:19 pm
What was the problem?
May 16, 2007 at 10:00 pm
That's just not the way we do things here... lot's of folks busted a hump trying to help and now you're not going to take the time to explain what you did to fix the problem? Where you gonna go the next time you need help?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 17, 2007 at 9:51 am
oops srry man been lots of demands here at work.
I never used fully qualified name to reference the object Patient_Dem2, which was in another db.
again srry guys
May 17, 2007 at 10:12 am
If you have more than one database on your server make sure that you are under the right database or use a fully qualified name in your proc. To test it just
type
Use 'whatever the database name is your procedure uses'
EXEC 'procedure name'
May 17, 2007 at 10:20 am
ok Jatinear, thx for the tip
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply