I am using Empty Migration to update a stored procedure in my database. A stored procedure is a custom stored process that was added when the database was created.
I found the "AlterStoredProcedure" method in the DbMigration class and this works to update the stored procedure, however I need to go through the stored procedure parameters and I want to set the default value for the boolean and some ints to null, but I can not get this to work.
AlterStoredProcedure(
name: "[dbo].[FT_People_PersonFullTextSearch]",
parametersAction:
p => 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....");
In the above code
ALTER PROCEDURE [dbo].[FT_People_PersonFullTextSearch]
@searchTerm [nvarchar](600),
@isArchived [bit] = 0,
@isActive [bit],
@genderFilter [int],
@rankingFilter [int]
AS
BEGIN
instead
ALTER PROCEDURE [dbo].[FT_People_PersonFullTextSearch]
@searchTerm nvarchar(600),
@isArchived bit = 0,
@isActive bit = null,
@genderFilter int = null,
@rankingFilter int = null
AS
BEGIN
Does anyone know how to get the parameters to create @isActive bit = null?