Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass a 2D array to a Stored procedure?

I'm trying to pass a 2D array from by C#.NET program to a stored procedure in SQL Server 2005. I dont know how to accomplish this. I'm gathering my data in a DataGridView.
Can anyone help me with this?

like image 406
Bibhas Debnath Avatar asked May 08 '11 08:05

Bibhas Debnath


1 Answers

SQL Server doesn't support arrays as such.

Depending on how much data you have, you can do something like this: How to Pass and Handle a Delimited String similar to handling an Array() of Values.

You can also read Erland Sommarskog's article on the subject of Arrays and Lists in SQL Server 2005 which outlines various different approaches to tackling the problem.

like image 152
Town Avatar answered Sep 30 '22 16:09

Town