title: SQL Server - GETUTCDATE() 'Incorrect syntax near )'
body: <p>Simple question: why does the top statement work, but the bottom one fails with</p>
  
  <blockquote>
    <p>'Incorrect syntax near ('</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>USE [Research]
  GO
  
  DECLARE @d datetime 
  SELECT @d = GETUTCDATE()
  
  DECLARE @return_value int
  
  EXEC    @return_value = [MyApp].[DateStamp]
          @date = @d
  
  SELECT  'Return Value' = @return_value
  
  GO
  </code></pre>
  
  <p>This one fails:</p>
  
  <pre><code>USE [Research]
  GO 
  
  DECLARE @return_value int
  
  EXEC    @return_value = [MyApp].[DateStamp]
          @date = GETUTCDATE()
  
  SELECT  'Return Value' = @return_value
  
  GO
  </code></pre>
  
  <p><code>DateStamp</code> is a proc that writes a bunch of stuff to a time dimension, like financial year, quarter etc.</p>
  
  <p>Thanks.</p>