1 2 CREATE TABLE T ( 3 int1 int , 4 bit1 bit NOT NULL DEFAULT 0 , 5 rvr1 timestamp , 6 usr1 nvarchar ( 28 ) DEFAULT USER , 7 createtime datetime DEFAULT CURRENT_TIMESTAMP 8 ) 9 GO
1 2 INSERT T (int1) VALUES ( 1 ) WAITFOR DELAY ' 00:00:01 ' 3 GO 4 INSERT T (int1, bit1) VALUES ( 2 , 0 ) WAITFOR DELAY ' 00:00:01 ' 5 GO 6 INSERT T (int1, bit1) VALUES ( 3 , 1 ) 7 GO
(1 rows affected)
1 SELECT int1, bit1, usr1, 2 CONVERT ( int , rvr1) ' Timestamp as int ' , 3 createtime 4 FROM T 5 GO
(3 rows affected)
1 2 UPDATE T 3 set bit1 = 1 4 WHERE int1 = 2 5 GO
1 SELECT int1, bit1, usr1, 2 CONVERT ( int , rvr1) ' Timestamp as int ' , 3 createtime 4 FROM T 5 GO
(3 rows affected)
1 2 drop table t 3 GO
from: