Is there a way to send a stored procedure the number of parameters it will accept, and then send that number of parameters?
For instance, I have the following table
TABLE: tbl_Item
FIELDS: ID (auto incrementing), partNumber, serialNumber
I am looking for a stored procedure that would look sort of like this:
sp_AddSerialNumbers strPartNumber, SN1, SN2, SN3, ..., SNn
I want to be able to INSERT a list of records which will all have the same 'partNumber', but a bunch of different 'serialNumbers'. The information will be coming in from an ASP web app, and I would like to find a way to send all of the information ( a part number, and a list of serial number strings ) to a stored procedure. Is there a way to have a stored procedure count the number of variables being sent, or is there a way to send a stored procedure the number of parameters it is about to receive?
I know I can just use a loop in my application that will create the variable number of INSERT statements, but I would like to do it with a stored procedure.
Can this be done?
Any other ideas?
For instance, I have the following table
TABLE: tbl_Item
FIELDS: ID (auto incrementing), partNumber, serialNumber
I am looking for a stored procedure that would look sort of like this:
sp_AddSerialNumbers strPartNumber, SN1, SN2, SN3, ..., SNn
I want to be able to INSERT a list of records which will all have the same 'partNumber', but a bunch of different 'serialNumbers'. The information will be coming in from an ASP web app, and I would like to find a way to send all of the information ( a part number, and a list of serial number strings ) to a stored procedure. Is there a way to have a stored procedure count the number of variables being sent, or is there a way to send a stored procedure the number of parameters it is about to receive?
I know I can just use a loop in my application that will create the variable number of INSERT statements, but I would like to do it with a stored procedure.
Can this be done?
Any other ideas?