string into parms

R

rodchar

hey all,
what's the best way to turn my csv string into sql parms? the sql parms can
vary in count.

thanks,
rodchar
 
M

Marc Gravell

Very unclear question... can you add some detail? At the surface,
you'd call string.Split(',') [assuming you aren't dealing with the
more complex CSV nuances], and then loop over the array, adding
parameters as needed.

Of course, if the purpose of the CSV is to get multiple values into
the database, then another option is to write a "split" method inside
the DB, either as an UDF or as a SQL/CLR proc - pass a string
(varchar(max)) into the db, and split internally, perhaps into a table-
variable.

In SQL2008, another option is a table-valued parameter.

Marc
 
R

rodchar

sorry about any confusions, i need to rethink and repost clearly. thanks,
for the help,
rod.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

check console args 3
method descriptions 4
How to convert/cast sqldbtype.int 3
Can't reference dll 11
threading 10
Print directly from SSRS2008 0
events revisited 3
Parsing XML 1

Top