title: Split strings or XML to send IDs to a stored procedure?
body: <p>I have an application in C#, and have to send a list of IDs (int) to my db in SQL Server to make a couple of  joins. I have the list of IDs in a Dataset on memory.</p>
  
  <p>I know two ways to do it: One, is to create a string with the id's separated by pipes, and split them in sql, inserting them in a temp table. Then I can do the joins that I want.</p>
  
  <p>The other way, is do "getXML" to my Dataset, and send it. Then, I can insert the info in a temp table, and do the joins that I want.</p>
  
  <p>Which way is better, and why? Or another option better than both?</p>
  
  <p>The number of IDs to pass are variable, using SQL Server 2005 and SQL Server 2008, Visual Studio 2010.</p>