There are a few options that you could use for this. The first would be to just set default values within the procedure declaration to guarantee that there would never be NULL values passed in for these parameters:
CREATE PROCEDURE [dbo].[sp_Example]
@parameter1 char (8) = 'test',
@parameter2 char (20) = 'test2'....
The second alternative to checking them one at a time is to just have a single statement that will set them based on a NULL value. Something along the lines of
ALTER PROCEDURE [dbo].[sp_Example]
@parameter1 char (8),
@parameter2 char (20),
@parameter3 char (20),
@parameter4 char (20),
@parameter5 char (20),
@parameter6 char (20),...
Select @parameter1 = CASE when @parameter1 is null then 'test' else @parameter1 end
,@parameter2 = Case when @parameter2 is null then 'test2' else @parameter2 end...
The other alternative is that if you just want to see if any of the values is NULL before performing the action, you could pretty easily do a single if statement that checks for that sort of thing
alter PROCEDURE [dbo].[sp_Example]
@parameter1 char (8) = NULL,
@parameter2 char (20) = NULL....
if @parameter1 is null or @parameter2 is null.....
print 'You passed in a NULL value for one of your parameters'
--your statement here
Depending on the value of the
CONCAT_NULL_YIELDS_NULL setting, you could also use:
IF (@Parameter1 + @Parameter2 + @Paramater3 ...) IS NULL
RAISERROR (N'One or more parameters is NULL', 1, 1);
-- other statements that will run if all @parameters are NOT null.
I am sure there are other alternatives as well, but I would think one of these would get you where you need to go.