title: How can I get the full milliseconds in SQL server?
body: <pre><code>DECLARE @Now DATETIME2(7) = SYSDATETIME();
  
  SELECT
      [Datetime2(1)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(1))),
      [Datetime2(2)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(2))),
      [Datetime2(3)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(3))),
      [Datetime2(4)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(4))),
      [Datetime2(5)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(5))),
      [Datetime2(6)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(6))),
      [Datetime2(7)] = DATEPART(MILLISECOND,CAST(@Now AS DATETIME2(7)))
  </code></pre>
  
  <p>Executing that returns the following example values:</p>
  
  <pre><code>300 260 265 264 264 264 264
  </code></pre>
  
  <p>How can I get more precision?</p>