SQL Server中与PostgreSQL类型“timestamp without time zone”等效的类型

21 浏览
0 Comments

SQL Server中与PostgreSQL类型“timestamp without time zone”等效的类型

PostgreSQL中\"timestamp without time zone\"与SQL Server中的类型相同是什么?

使用DateTime是否可以?

admin 更改状态以发布 2023年5月21日
0
0 Comments

对于新开发,您可以使用datetime2数据类型,而不是“普通”datetime。它存储没有时区的时间戳,并允许您指定您的系统所需要的精度。

要获得1微秒的精度,相当于PostgreSQL中的timestamp without time zone,您需要指定6个小数位的精度,即

datetime2(6)

有关为什么Microsoft建议使用datetime2的详细信息,请参见此答案。

0