PDA

Click to See Complete Forum and Search --> : Passing Arrays to Stored Procedures


magnus.karlsson
Aug 24th, 2000, 04:41 AM
I don't think that there is any way to pass an array into a stored procedure. I would have joined the array into a string using the Join-function and then splitting it up again in the sp using the charindex-function.

Maybe it's the way you have done it today?

Magnus

666539
Aug 24th, 2000, 09:13 AM
You can pass an array of values to a stored prodedure.

For example, if you had the stored procedure:

CREATE PROCEDURE [test_del]
@HeaderNumber int,
@LineItemNumber int
as
delete from testlineitem where headernumber = @HeaderNumber and LineItemNumber = @LineItemNumber

You could use:

cmd.execute , array(1,2)

To delete a line item record with a header number of 1 and a line item number of 2.