BUG: UNION with Local Variables GP Faults ServerID: Q87312
|
BUG# OS/2: 1435 (4.2)
NT: 851 (4.2)
If you use a union operator to link two select statements that assign
values to local variables, SQL Server for OS/2 will general protection
fault (GP fault), and SQL Server for Windows NT will have an access
violation. However, in SQL Server for Windows NT, only the client
connection that runs the query is terminated. The rest of the clients are
not affected.
For example, the following query GP faults SQL Server:
declare @v int
select @v=1
UNION
select @v=1
go
SQL Server incorrectly handles the UNION operation if you use the UNION operator to assign multiple values to a local variable.
Do not use the UNION operator with local variables. If you are trying to assign different values to a local variable depending on variable conditions, use IF statements instead.
Microsoft has confirmed this to be a problem in SQL Server version 4.2 and Microsoft SQL Server versions 4.2, 4.21, and 4.21a. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Additional query words: Transact-SQL language_exec Windows NT
Keywords : kbprg kbbug4.20 SSrvServer SSrvWinNT
Version : 4.2 | 4.2 4.21 4.21a
Platform : OS/2 WINDOWS
Issue type :
Last Reviewed: March 16, 1999