title: Stored procedure call with an ISNULL in the assignment. Invalid Syntax?
body: <p>Above the call to this stored procedure is another call to a different stored procedure. The first procedure will assign something to <code>@NewIdentifier</code> if it needs to, otherwise I need to use the default <code>SaleId</code>.</p>
  
  <pre><code>exec myStoredProc @SaleId = ISNULL(@NewIdentifier, @SaleId)
  </code></pre>
  
  <p>It works if I do it this way</p>
  
  <pre><code>declare @Id int
  set @Id = ISNULL(@NewIdentifier, @SaleId)
  exec myStoredProc @SaleId = @Id
  </code></pre>
  
  <p>Is it possible to use <code>ISNULL</code> in the assignment of a stored procedure parameter? I'm not sure what is invalid about this syntax.</p>