日期范围广 0001-01-01 到 9999-12-31。
时间范围广 00:00:00 到 23:59:59.9999999。
-----------------DATE --只存储日期 select cast('2016-10-13 12:23:30' as date) --输出结果:2016-10-13 -----------------TIME select cast('2016-10-13 12:23:30' as TIME) --只存储时间 --输出结果:12:23:30.0000000 -----------------TIMESTAMP --时间戳的二进制数 select cast('2016-10-13 12:23:30' as timestamp) --输出结果:0x323031362D31302D -----------------DATETIME --存储标准时间 select cast('2016-10-13 12:23:30' as DATETIME) --输出结果:2016-10-13 12:23:30.000 -----------------DATETIME2 select cast('2016-10-13 12:23:30' as DATETIME2) --输出结果:2016-10-13 12:23:30.0000000 -----------------DATETIMEOFFSET select cast('2016-10-13 12:23:30' as DATETIMEOFFSET) --输出结果:2016-10-13 12:23:30.0000000 +00:00