Wednesday, March 21, 2012

Invalid object name

Hi Folks,

Need a bit of help with a problem I'm having:

ODBC Error Code = S0002 (Base table not found)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'UsersVsPages'.

SQL = "delete from Pages Where Page_Key = 147"

The above error message is returned when running a piece of code. The
table "UsersVsPages" that can't be found did exist but I dropped it
when it became unnecessary. I also set up a diagram with cascading
deletes etc. This is where I'm guessing the problem originates but
having looked through the relationships of "Pages" I have been unable
to find any reference to "UsersVsPages".

Can anyone point me in the right direction?

Thanks

Dave A."David Armstrong" <ukprototype@.yahoo.com> wrote in message
news:307ccadf.0407070835.7934080f@.posting.google.c om...
> Hi Folks,
> Need a bit of help with a problem I'm having:
> ODBC Error Code = S0002 (Base table not found)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> 'UsersVsPages'.
>
> SQL = "delete from Pages Where Page_Key = 147"
>
> The above error message is returned when running a piece of code. The
> table "UsersVsPages" that can't be found did exist but I dropped it
> when it became unnecessary. I also set up a diagram with cascading
> deletes etc. This is where I'm guessing the problem originates but
> having looked through the relationships of "Pages" I have been unable
> to find any reference to "UsersVsPages".
> Can anyone point me in the right direction?
>
> Thanks
> Dave A.

Another possibility might be a trigger which still references the old table.
If that's not the case, you could use Profiler to watch the SQL sent to the
server, to make sure it's really executing what you think it is.

Simon|||Thanks very much Simon, it was a trigger. Being new to MSSQL I wasn't
aware of this feature. Again thanks for the help.

Dave A.

"Simon Hayes" <sql@.hayes.ch> wrote in message news:<40ec33b7$1_3@.news.bluewin.ch>...
> "David Armstrong" <ukprototype@.yahoo.com> wrote in message
> news:307ccadf.0407070835.7934080f@.posting.google.c om...
> > Hi Folks,
> > Need a bit of help with a problem I'm having:
> > ODBC Error Code = S0002 (Base table not found)
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> > 'UsersVsPages'.
> > SQL = "delete from Pages Where Page_Key = 147"
> > The above error message is returned when running a piece of code. The
> > table "UsersVsPages" that can't be found did exist but I dropped it
> > when it became unnecessary. I also set up a diagram with cascading
> > deletes etc. This is where I'm guessing the problem originates but
> > having looked through the relationships of "Pages" I have been unable
> > to find any reference to "UsersVsPages".
> > Can anyone point me in the right direction?
> > Thanks
> > Dave A.
> Another possibility might be a trigger which still references the old table.
> If that's not the case, you could use Profiler to watch the SQL sent to the
> server, to make sure it's really executing what you think it is.
> Simon

No comments:

Post a Comment