FIX: SELECT Into Variable with NO_BROWSETABLE Fails

ID: Q178366


The information in this article applies to:

BUG #: NT: 17676 (6.5)

SYMPTOMS

If NO_BROWSETABLE is set ON, selecting data into a variable from a table with a timestamp column fails with the following message:

DB-Library: Possible network error: Bad token from SQL Server:
Datastream processing out of sync.
Net-Library error 0:

DB-Library Process Dead - Connection Broken
A sample script that demonstrates the problem is provided in the MORE INFORMATION section of this article.


WORKAROUND

To work around this problem, remove the timestamp column from the table.


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 5a for Microsoft SQL Server version 6.5. For information about downloading and installing the latest SQL Server Service Pack, see http://support.microsoft.com/support/sql/.

For more information, contact your primary support provider.


MORE INFORMATION

This problem does not occur on builds of SQL Server earlier than 6.50.258 (Service Pack 3). This problem has been tested and reproduced on SQL Server build 6.50.281 (Service Pack 4).

SET NO_BROWSETABLE ON is an undocumented option performed for Remote Data Service (RDS) ActiveX Data Connector (ADC) connections to SQL Server. Enabling this option makes every SELECT statement act as though FOR BROWSE had been appended to the statement, but bypasses the temporary table that FOR BROWSE normally pipes the results through. The net effect is to add keys and timestamps to the query as hidden output columns so the client can update specific rows (updateable cursors) without separate trips to the server to pick up the meta-data and munging the query to get the appropriate columns.

The following script demonstrates the problem:


   set nocount on
   go
   use pubs
   go
   DROP TABLE test_unknown_token1
   go
   CREATE TABLE test_unknown_token1 (

      col1 char(1),
      timestamp timestamp
   )
   go

   insert test_unknown_token1 (col1) values ('1')
   go

   set no_browsetable on
   go
   declare @ochrStatus char(1)

   SELECT @ochrStatus = col1
   FROM dbo.test_unknown_token1
   WHERE col1='1' 

Additional query words: sp sp3 sp4 temp


Keywords          : SSrvProg kbbug6.50 kbbug6.50.sp3 kbbug6.50.sp4 kbfix6.50.SP5 
Version           : 
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: April 21, 1999