Home > database >  The SQL procedure call
The SQL procedure call

Time:11-21

A SQL procedure is as follows:

Create PROCEDURE [dbo] [pr_test] @ lc_a char (10), @ lc_b char (10), @ lc_c char (10), @ lc_d char (10)
AS
The begin
If @ lc_a='1'
The begin
Select 'AAA' as mesg
End
If @ lc_b='2'
The begin
Select 'AAA' as mesg
End
The else
Select 'Other' as mesg
End

The following procedure call normal:
The EXEC pr_test '1', ' ', ' ', '
The EXEC pr_test ', '2', ' ', '
The EXEC pr_test '1', '2', ', '

Insufficient pass parameters, invoke an error, such as:
The EXEC pr_test '1'

Excuse me, how to modify process, to ensure that parameter is insufficient, the calling process is not an error?

CodePudding user response:

Set up how many parameters must be passed many parameters.

CodePudding user response:

Can give parameters to set the default values
  • Related