c# 4.0 - How to store as a comma separated list of values stored in a string, in SQL server -


i have string called joined contains range of values comma separated list.

for example when print joined output follows.

59.05,59.00,58.96,58.95,58.95,58.95,58.95,58.96,60.30,61.32 

what want know is, how can store sting variable in sql server. want store is, database won't grow unnecessarily.

can please kind enough give me piece of code showing how this.

if have comma separated string in .net can pass directly column value. please make sure column length have sufficient enough store whole string otherwise truncated. using varchar(max) column data type.

cmd.parameters.add("@joined", sqldbtype.varchar).value = joined.text; 

to save space can use varchar instead of nvarchar.


Comments