Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to store multiple value in sql server, i have done this in Oracel but it in SQL server i am able to do that please suggest some aleternate

What I have tried:

i have tired using Declare but it doesnt store value longer
Posted
Updated 18-May-18 19:55pm

1 solution

You can't store an array in a single cell and it would be a bad idea to try - you can do it by converting each element of the array to a string and concatenate them to form CSV data, but that's a nightmare to work with later.

If you are trying to store an array into multiple rows, that's not too bad at all: convert your array to a DataTable and use the SqlBulkCopy.WriteToServer Method (DataRow[]) (System.Data.SqlClient)[^]
 
Share this answer
 

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