title: SQL Server: intrigued by GETDATE()
body: <p>I have SQL Server 2005 Standard Service Pack 2  9.00.4053.00 (Intel X86) </p>
  
  <p>Table has close to 30 million rows..</p>
  
  <p>If I do </p>
  
  <pre><code>SELECT GETDATE(), * FROM
  &lt;table&gt;
  </code></pre>
  
  <p><strong>Identical Date and time value is returned including milliseconds part</strong>.. though query took more then 3 minutes to complete...</p>
  
  <p>I have already read </p>
  
  <p><a href="http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx" rel="nofollow noreferrer">http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx</a></p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/66507b8b-4a74-44c1-9637-3ab5f75db6a0" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/66507b8b-4a74-44c1-9637-3ab5f75db6a0</a></p>
  
  <p>One of the link I posted (marked answer) suggest that prior to SQL 2005 GETDATE was deterministic 
  although SQL 2000 BOL states GETDATE is nondeterministic</p>
  
  <p>If I do an update with millions of rows </p>
  
  <pre><code>UPDATE tableName
  SET dateColumn = GETDATE()
  </code></pre>
  
  <p>I know you really want to do</p>
  
  <pre><code>DECLARE @DT datetime
  SET @DT = GETDATE()
  UPDATE table
  SET datecol =@DT
  </code></pre>
  
  <p>I am really confused </p>
  
  <p>What would be expected behavior?</p>
  
  <ol>
  <li>In case of select statement  I posted earlier</li>
  <li>Behavior of update statement </li>
  </ol>
  
  <p>Considering you are updateing a datecolun on a table with 100 million rows 
  Would datecolumn will have identical date and time in milliseconds....?</p>