BUG: UNION with Local Variables GP Faults ServerLast reviewed: April 28, 1997Article ID: Q87312 |
The information in this article applies to:
NT: 851 (4.2) SYMPTOMSIf 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 goIt is unlikely that you would build such a query, because it assigns multiple values to a single local variable.
CAUSESQL Server incorrectly handles the UNION operation if you use the UNION operator to assign multiple values to a local variable.
WORKAROUNDDo 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.
STATUSMicrosoft 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |