SQL Server timestamp 的使用

两种方法将二进制的timestamp进行转化
select convert(bigint,ts) ts from table_name
create table #tb(id int,dt timestamp) 
insert #tb(id) select 1 
insert #tb(id) select 2 
insert #tb(id) select 3 
select *,ddate=cast(dt as datetime) from #tb id dt ddate 
----------- ------------------ ----------------------- 
1 0x00000000000007D1 1900-01-01 00:00:06.670 
2 0x00000000000007D2 1900-01-01 00:00:06.673 
3 0x00000000000007D3 1900-01-01 00:00:06.677 (3 行受影响)

你可能感兴趣的:(SQL Server)