title: Loop through an comma separated array to insert in a table SQL Server
body: <p>Basically this is what I want to achieve. I am receiving both UserId and ProductId as parameters on my stored procedure, which inserts those values into a table called <code>UserProduct</code>. The <code>ProductId</code> is supplied as a comma separated array parameter and the <code>UserId</code> as a single integer value. </p>
  
  <p>The following is the result set sample of what I want to achieve after select statement from this table. Is this achievable? Thanks in advance. </p>
  
  <pre><code>UserId  ProductId
  -------------------
  817      7 
  817      5
  817     33
  798      6
  798     12
  798      2
  798      4
  888      5
  ...    ...
  </code></pre>