Friday, March 23, 2012

Problem querying SysObjects and SysIndexes

When executing a basic query against (see below) the system object
table in a SQL 2000 database it displays the following error.
SELECT 1 FROM SYSOBJECTS
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'SYSOBJECTS'.
The table does exist and the query is being run as an account with SQL
Admin privileges. This also occurs when trying to query the SysIndexes
table. Other databases on the server are able to query these tables.
What is causing this problem on this one database and how can it be
resolved?Some ideas.
1)Try SELECT 1 FROM sysobjects
2)Try SELECT 1 FROM dbo.sysobjects
--
Jack Vamvas
___________________________________
Need an IT job? http://www.ITjobfeed.com/SQL
"Robin9876" <robin9876@.hotmail.com> wrote in message
news:1190368228.718871.96350@.57g2000hsv.googlegroups.com...
> When executing a basic query against (see below) the system object
> table in a SQL 2000 database it displays the following error.
> SELECT 1 FROM SYSOBJECTS
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'SYSOBJECTS'.
> The table does exist and the query is being run as an account with SQL
> Admin privileges. This also occurs when trying to query the SysIndexes
> table. Other databases on the server are able to query these tables.
> What is causing this problem on this one database and how can it be
> resolved?
>|||> What is causing this problem on this one database and how can it be
> resolved?
Object name case sensitivity is determined by the database collation. I
suspect the following query will return a case-sensitive collation:
SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Robin9876" <robin9876@.hotmail.com> wrote in message
news:1190368228.718871.96350@.57g2000hsv.googlegroups.com...
> When executing a basic query against (see below) the system object
> table in a SQL 2000 database it displays the following error.
> SELECT 1 FROM SYSOBJECTS
> Server: Msg 208, Level 16, State 1, Line 1
> Invalid object name 'SYSOBJECTS'.
> The table does exist and the query is being run as an account with SQL
> Admin privileges. This also occurs when trying to query the SysIndexes
> table. Other databases on the server are able to query these tables.
> What is causing this problem on this one database and how can it be
> resolved?
>|||Since posting I had resolved it.
I already thought of the suggestions that Jack posted, it was what Dan
has suggested a particular 3rd party database had been setup as case
sensitive.
On 21 Sep, 12:22, "Dan Guzman" <guzma...@.nospam-online.sbcglobal.net>
wrote:
> > What is causing this problem on this one database and how can it be
> > resolved?
> Object name case sensitivity is determined by the database collation. I
> suspect the following query will return a case-sensitive collation:
> SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Robin9876" <robin9...@.hotmail.com> wrote in message
> news:1190368228.718871.96350@.57g2000hsv.googlegroups.com...
> > When executing a basic query against (see below) the system object
> > table in a SQL 2000 database it displays the following error.
> > SELECT 1 FROM SYSOBJECTS
> > Server: Msg 208, Level 16, State 1, Line 1
> > Invalid object name 'SYSOBJECTS'.
> > The table does exist and the query is being run as an account with SQL
> > Admin privileges. This also occurs when trying to query the SysIndexes
> > table. Other databases on the server are able to query these tables.
> > What is causing this problem on this one database and how can it be
> > resolved?

No comments:

Post a Comment