Mega Code Archive

 
Categories / MSSQL Tutorial / Constraints
 

Insert to a table with default value

2>  CREATE TABLE T ( 3>     int1 int, 4>     bit1 bit NOT NULL DEFAULT 0, 5>     rvr1 timestamp, 6>     usr1 nvarchar(128) DEFAULT USER, 7>     createtime datetime DEFAULT CURRENT_TIMESTAMP 8> ) 9> GO 1> 2> INSERT T (int1, bit1) VALUES (3, 1) 3> GO (1 rows affected) 1> 2> drop table t; 3> GO