34,594
社区成员
发帖
与我相关
我的任务
分享
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Table_1](
[timestamp] [timestamp] NULL
) ON [PRIMARY]
GO
declare @t timestamp
set @t=0x00000000000007D8
--联机丛书中如是说:
--@@DBTS 返回当前数据库最后使用的时间戳值。插入或更新包含 timestamp 列的行时,将产生一个新的时间戳值。
select @@DBTS
go
create table tb(id int,ts timestamp)
insert into tb(id) select 1
go
select @@DBTS
insert into tb(id) select 1
go
select @@DBTS
go
drop table tb
/*
------------------
0x00000000000007D3
(1 行受影响)
(1 行受影响)
------------------
0x00000000000007D4
(1 行受影响)
(1 行受影响)
------------------
0x00000000000007D5
(1 行受影响)
*/
select @@dbts
CREATE TABLE ExampleTable (PriKey int PRIMARY KEY, timestamp);
insert into ExampleTable(PriKey ) select 1