FIX: SELECT Local Variable with FOR BROWSE Drops Connection
  
PSS ID Number: Q104784
Article last modified on 10-31-1994
 
4.20 | 4.20
 
OS/2 | WINDOWS
 

----------------------------------------------------------------------
The information in this article applies to:
 
  - Microsoft SQL Server version 4.2 for OS/2
  - Microsoft SQL Server version 4.2
----------------------------------------------------------------------
 
BUG# OS/2: 1705 (4.2)
       NT: 272 (4.2)
 
SYMPTOMS
========
 
A SELECT with an assignment to a local variable in the SELECT clause
and a FOR BROWSE clause may trap the server or disconnect the user's
connection with an error:
 
   10008 Bad Token
 
This only happens when a unique index exists on the table being selected
from.
 
For example:
   DECLARE @ordnum int
   SELECT @ordnum = OrderNumber FROM SaleOrder
      WHERE OrderNumber = 1
      FOR BROWSE
 
WORKAROUND
==========
 
Do not use the FOR BROWSE clause in a Transact SQL statement when values
are being selected into local variables. The FOR BROWSE clause is
designed to be used with DB-Library applications, and is not designed to
be used in cases like this.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in SQL Server version 4.2
for OS/2 and Microsoft SQL Server version 4.2. This problem was
corrected in SQL Server version 4.2aK11 for OS/2. For more information,
contact your primary support provider.
 
Additional reference words: 4.20 4.20a Transact SQL T-SQL
KBCategory: kbprg
KBSubcategory: SSrvServer SSrvWinNT
 
=============================================================================
 
Copyright Microsoft Corporation 1994.
