Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need a stored procedure which takes a session token var-char(150) and an array having values like (First Name, Last Name,DOB,Education) for e.g (vinay,Bhavsar,17031986,MCA),(Rohit,Mandiwal,17031986,MCA),(Ankit,Shukla,17031986,MBA) at a time and check the database these data are present according to session token given .If data are present then it will store all the data in a new table.....someone please help me to creating this storedprocedure.
Posted

Hi,
The below article might be helpful.

Sending a DataTable to a Stored Procedure[^]
 
Share this answer
 
Comments
StianSandberg 17-Aug-12 3:28am    
Hi,
The below article might be helpful.


http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm[^]




---:TK:---
 
Share this answer
 
If you are using sql server 2008 then only it is possible send array as parameter
Using Table-Valued Functions in SQL Server[^]
 
Share this answer
 
Comments
Manash Sahoo 17-Aug-12 3:03am    
i m using microsoft azure database....
You could convert the array to a delimited string and extract it again in the stored procedure.
C#
int[] arr = {0,1,2,3,0,1};
string result = arr.Aggregate("", (s, i) => s + ";" + i.ToString());

Try these links:
Parse delimited string in a Stored procedure[^]
Array Parameter Handling in a Stored Procedure[^]


--Amit
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900