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

I am trying to pass a 2D array from a C#.NET program to a stored procedure in SQL Server 2005 . I do not know how to do that. I am collecting my data in a DataGridView .
Can anyone help me with this?

+6
source share
2 answers

SQL Server does not support arrays per se.

Depending on how much data you have, you can do something like this: How to pass and process a delimited string, similar to processing an array () of values .

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

+6
source

There is an excellent article at SqlServerCentral by Jeff Moden on how to split a CSV list on an Sql server. The table table approach is also shown in an article by Erland Sommarskog, but it seems that these are slightly different concepts. Therefore, it may be worth comparing the performance of the two.

+2
source

Source: https://habr.com/ru/post/887547/


All Articles