What is the meaning of the following SQL Server declaration: datetime2(7)?

一个人想着一个人 提交于 2021-02-04 11:48:23

问题


Inside a SQL Server query, there is: datetime2(7).
I know datetime2, but I don't understand (7).

Can you explain the meaning of (7)?


回答1:


datetime2 [ (fractional seconds precision) ]

It's the fractional seconds precision according to the MSDN documentation.

http://msdn.microsoft.com/en-us/library/bb677335.aspx

This is the microsoft example of 4:

DECLARE @datetime2 datetime2(4) = '12-10-25 12:32:10.1234';

So I would assume that 7 would be:

DECLARE @datetime2 datetime2(7) = '12-10-25 12:32:10.1234567';


来源:https://stackoverflow.com/questions/17260503/what-is-the-meaning-of-the-following-sql-server-declaration-datetime27

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!