On Microsoft SQL Server 2008 I realized a stored procedure which contains more than 20 parameters, in this SP I update or insert data into table which does not accept null values.
I need to evaluate if one of these parameters contain a null value before performing the insert or update into table.
Example:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_Example]
@parameter1 char (8),
@parameter2 char (20),
@parameter3 char (20),
@parameter4 char (20),
@parameter5 char (20),
@parameter6 char (20),
@parameter7 char (20),
@parameter8 char (40),
@parameter9 char (15),
@parameter10 char (15) ,
@parameter11 char (15)...
I have a possible solution for this, which is performing evaluation parameter by parameter and validate if is null
add some value, but I'm looking for a better solution for this.