问题
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