title: how to update a nullable column in sql server stored procedure
body: <p>I have a stored procedure that takes care of updates to my person table.  I don't always update every column so I've provided default values (null) for some of the procedure parameters.  But, what if I really want to set the person.middleinitial to null?  How does the procedure know my intent?</p>
  
  <p>In reality my person table has LOTS of columns and many are nullable so this can become burdensom depending on the solution.</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[uspPerson_update]     
  @id uniqueidentifier,     
  @fname nvarchar(20) = NULL,     
  @minitial nvarchar(1) = NULL,     
  @lname nvarchar(20) = NULL 
  AS BEGIN     
  SET NOCOUNT ON;     
  UPDATE Person      
  SET 
  fname=ISNULL(@fname,fname),          
  minitial=ISNULL(@minitial,minitial),          
  lname=ISNULL(@lname, lname)
  WHERE id=@id 
  END
  </code></pre>