BUG: Use <Database> Does Not Properly Change @@DBTS ContextID: Q157518
|
The Use <Database> statement does not change the context of the @@DBTS, unless the Use <Database> statement is run in a separate Transact-SQL batch.
To work around this problem place the Use <Database> statement in a separate batch.
use pubs
go
select db_name(), @@DBTS
go
use tempdb
select db_name(), @@DBTS
go
select db_name(), @@DBTS
go
------------------------------ ------------------
pubs 0x0100000097180000
**ERROR, database context is really tempdb but @@DBTS value belongs to
PUBS
------------------------------ ------------------
tempdb 0x0100000097180000
------------------------------ ------------------
tempdb 0x010000003e1a0000
Keywords : kbusage SSrvTran_SQL kbbug6.50 kbbug6.00
Version : 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: April 3, 1999