一、插入TIMESTAMP类型数据
在已经建好的表中插入TIMESTAMP类型数据
CREATE TABLE table_name(
[id] [int] IDENTITY(1,1) NOT NULL,
[timestamp] [timestamp] NULL,
[name] [datetime] NULL)
1、INSERT INTO TABLE_NAME (TIMESTAMP) VALUES(DEFAULT)
2、直接不插入该列值,插入其他两列即可。timestamp列默认插入default数据
二、sql转换数据类型
SELECT TIMESTAMP
,CAST(TIMESTAMP AS VARBINARY(8)) AS 'TIMESTAMP转十六进制字符串'
,CONVERT(BIGINT,TIMESTAMP) AS 'TIMESTAMP转bigint类型'
,CONVERT(int,TIMESTAMP) as 'int类型64位'
FROM table_name