0

I'm doing a request to a DWH which is very long so I will just point where my problem is:

DW_PUR_OrderlineActual.LogComp In (11,18,54,68,92,159,164)

I'm doing this condition in a where clause and I would like to do it in a prepared request. In fact I have a List with the different values that go in this condition and I would like to have somthing like this:

DW_PUR_OrderlineActual.LogComp In ?

In which I could replace the "?" with my list.

Sulthan
  • 128,090
  • 22
  • 218
  • 270
Leep
  • 447
  • 1
  • 3
  • 11
  • 1
    possible duplicate of [Parameterizing an SQL IN clause?](http://stackoverflow.com/questions/337704/parameterizing-an-sql-in-clause). Look at the answer provided by Mark Brackett on December 3, 2008. – Mike Perrenoud May 28 '13 at 15:24
  • Thank you, it is exactly what I was looking for. Thanks all for your help ! Can you tell me what I need to do with this post ? I delete it ? – Leep May 28 '13 at 20:24

1 Answers1

0

I think what you're trying to do is to load a long list of values to the database. I have successfully used the SqlBulkCopy class to load as many as 10,000 rows per second for simple dumps into a single table. The usage is pretty straightforward. You can pass it an array of DataRow objects, a DataTable, or a DataReader that it can read from.

Tombala
  • 1,660
  • 9
  • 11
  • Thank you for your answer but I'm not looking for performance. I just need to know how can I do a prepared request with what I said before in a where clause. And I want to fill the "?" with a list of values. Do you know how I can do it ? – Leep May 28 '13 at 14:52