39

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)?

Shin
  • 664
  • 2
  • 13
  • 30

1 Answers1

58
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';
Adam
  • 1,149
  • 10
  • 12