jasonsalas
IS-IT--Management
I'm trying to allow a large form to be sent and processed by using a SQL Server stored procedure. I declared several variables for the SP, like so:
CREATE PROCEDURE sp_CastVote
@PERSON1 smallint,
@PERSON2 smallint,
@PERSON3 smallint,
...
@PERSONn smallint
AS
INSERT INTO tableName (f1,f2,f3...fn) VALUES (@PERSON1, @PERSON2,@PERSON3...@PERSONn)
GO
However, the fields aren't each required in the form, and when they pass empty values, I get a SQL error saying "expected a parameter." Does anyone know how I can get around this?
CREATE PROCEDURE sp_CastVote
@PERSON1 smallint,
@PERSON2 smallint,
@PERSON3 smallint,
...
@PERSONn smallint
AS
INSERT INTO tableName (f1,f2,f3...fn) VALUES (@PERSON1, @PERSON2,@PERSON3...@PERSONn)
GO
However, the fields aren't each required in the form, and when they pass empty values, I get a SQL error saying "expected a parameter." Does anyone know how I can get around this?