T SQL - Passing table variables through a stored procedure
<p>Let's say I have a stored procedure:</p>

<pre><code>exec my_sp ?,?
</code></pre>

<p>I can execute this stored procedure by adding two values e.g.</p>

<pre><code>exec my_sp 'value 1','value 2'
</code></pre>

<p>Now this is where things get tricky.....</p>

<p>I have a table for example</p>

<pre><code>1  |  2
aa   bb
cc   dd
</code></pre>

<p>and so on.......</p>

<p>Now I want to pass my table values through and create one table of results e.g.</p>

<pre><code>exec my_sp 'aa','bb'

exec my_sp 'cc','dd'
</code></pre>

<p>and so on..........</p>

<p>How can I achieve this?</p>