如下倒子:
Create  table  chl_test
( test1 datetime,
  test2 smalldatetime );

insert into chl_test values('14:23:28','14:23:28');
select * from chl_test;

结果:
         test1                                              test2
1900-01-01 14:23:28.000                1900-01-01 14:23:00


在读取该数据时不管你的字段是datetime或smalldatetime读出来的格式都一样(如:1900-01-01)。datetime不会显示出他的毫秒,但是在进行时间比较时他要毫秒就会出现,从而让两个时间段不能相等。

datetime占8字节,精度3.33毫秒,时间从1753.1.1到9999.12.31  
  smalldatetime占4字节,精度1分钟,时间从1900.1.1到2079.6.6

相关文章:

  • 2021-08-06
  • 2021-09-28
  • 2021-11-26
  • 2021-11-26
  • 2021-04-03
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2021-06-19
  • 2021-12-30
  • 2022-12-23
  • 2021-11-26
  • 2022-01-04
相关资源
相似解决方案