Microsoft KB Archive/157518

= BUG: Use  Does Not Properly Change @@DBTS Context =

Article ID: 157518

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 6.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q157518



BUG #: 15634 (WINDOWS 6.50)



SYMPTOMS
The Use  statement does not change the context of the @@DBTS, unless the Use  statement is run in a separate Transact-SQL batch.



WORKAROUND
To work around this problem place the Use  statement in a separate batch.



STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The following query demonstrates the problem:

use pubs go select db_name, @@DBTS go use tempdb select db_name, @@DBTS go select db_name, @@DBTS go

The following is the result of the query above:

-- -- pubs                          0x0100000097180000

PUBS
 * ERROR, database context is really tempdb but @@DBTS value belongs to

-- -- tempdb                        0x0100000097180000

-- -- tempdb                        0x010000003e1a0000

Keywords: kbbug kbusage KB157518

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.