How to pass a collection of data to SQL Server
Hi all. If you are faced with a situation where you wish to send an array of strings(say) to the Server, then you have stumbled to the correct page :-) To start off with, SQL server up to 2005 does not support Arrays. So, it becomes a bit difficult for Java,C#,C++ programmers who are very fond of arrays to get their job done. Fortunately there is a detour which enables us to get the job done. Instead of sending the list as an array, we can append a delimiter(here I used the comma) and send the complete string to the server side. At the server side, it splits the separate strings by the delimiter and inserts them into a table(her I used it as a single column table of the form tmpTable(_name varchar(50))) You can use the values inserted into this table and use the results similar to having an array. NOTE: It does not support the sophisticated array functions you are used to, but it will let you get the job done. /* PROCEDURE NAME : readCSV AUTHOR : Ruchira Randana PROCEDURE DESC...