PRSQL9111005: Testing for Dynamic Tables Breaks Connection

ID Number: Q78362

1.11

OS/2

buglist1.11

Summary:

SYMPTOMS

SQL Server incorrectly handles a query that checks for existence of

data in one of the dynamically built system tables in the master

database. The following query

IF EXISTS (SELECT * FROM syslocks)

PRINT "Locks exist."

go

causes SQL Server to report the following errors:

Unintelligible query plan step encountered.

(Msg 222, Level 20, State 2).

The SQL Server is terminating this process.

(Msg 5702, Level 0, State 1).

CAUSE

This error occurs if the table in the FROM clause is any of the

three dynamically built system tables in the master database:

syslocks, sysprocesses, or syscurconfigs. These three tables do not

always exist in SQL Server; they are dynamically built when a user

queries them.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version

1.11. This problem does not occur in SQL Server version 4.2.

More Information:

After the error is received, attempting to issue any other queries

will terminate the application session. However, the SQL Server

remains running, and can be reconnected to from the application.