title: Alter Stored Procedure in DB Migration EF 6 Code First - how to pass through null as default for a parameter
body: <p>I am using an Empty Migration to update a stored procedure in my database. The stored procedure is a custom stored proc that was added in the intial creation of the database.</p>
  
  <p>I have discovered the 'AlterStoredProcedure' method in the DbMigration class and this works to update the stored procedure, however I have to pass through the parameters of the stored procedure and I want to set the default value of a boolean and some ints to null, but I can't seem to get this to work.</p>
  
  <pre><code>    AlterStoredProcedure(
                      name: "[dbo].[FT_People_PersonFullTextSearch]",
                      parametersAction: 
                         p =&gt; new { 
                                     searchTerm = p.String(600), 
                                     isArchived = p.Boolean(false), 
                                     isActive = p.Boolean(null), 
                                     genderFilter = p.Int(null), 
                                     rankingFilter = p.Int(null) 
                                   },
                      body: "the body of my stored proc....");
  </code></pre>
  
  <p>The above code produces</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[FT_People_PersonFullTextSearch]
      @searchTerm [nvarchar](600),
      @isArchived [bit] = 0,
      @isActive [bit],
      @genderFilter [int],
      @rankingFilter [int]
  AS
  BEGIN
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[FT_People_PersonFullTextSearch]
      @searchTerm nvarchar(600), 
      @isArchived bit = 0,
      @isActive bit = null,
      @genderFilter int = null,
      @rankingFilter int = null
  AS 
  BEGIN
  </code></pre>
  
  <p>Does anyone know how to get the parameters to produce <code>@isActive bit = null</code>?</p>