Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

can i pass a List into a SqlCommand as a paramter?



i realize i could just loop over the list but i was looking for a cleaner solution.

share|improve this question
Belongs on stackoverflow – gbn May 14 '10 at 16:22
agreed it there a process to migrate this to my account on SO? – Christopher Kelly May 17 '10 at 12:42
up vote 2 down vote accepted

No, you can't in the current form

There are several options using UDFs or XML or dynamic SQL to pass in lists.

The most comprehensive article on how to do this is "Arrays and Lists in SQL Server 2005 and Beyond" by Erland Sommarskog

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.