title: Clarification of the NewID() function
body: <p>I have a stored procedure which accepts two parameters of type <code>UniqueIdentifier</code></p>
  
  <p>When I call this sproc with an explicit call to <code>NewId()</code> in place of one of the arguments:</p>
  
  <pre><code>exec dbo.TestArgs newid, '34131101-04DE-4B97-8FAC-49C924F7BFCE'
  </code></pre>
  
  <p>it fails with:</p>
  
  <blockquote>
    <p>Error converting data type nvarchar to uniqueidentifier.</p>
  </blockquote>
  
  <p>But passing a variable populated by <code>NewId()</code> into the call is fine:</p>
  
  <pre><code>DECLARE @painInTheArse UniqueIdentifier
  SET @painInTheArse = NewID()
  </code></pre>
  
  <p><code>EXEC dbo.TestArgs</code><strike><code>newid</code></strike><code>@painInTheArse,'34131101-04DE-4B97-8FAC-49C924F7BFCE'</code>  </p>
  
  <p>works perfectly</p>
  
  <p>To me this just seems very wrong. Can someone please explain?</p>