Insert into table values from single variable SQL stored procedure
<p>Is there any way to capture the values to be inserted to a table into one variable as comma separated values and use the variable to execute <code>insert into</code> statement.  For example, create a test table as </p>

<pre><code>create table id_test (id int, name varchar(10))
</code></pre>

<p>declare a variable and set the value for the variable to be the values to be inserted into table with comma separated as shown below:</p>

<pre><code>declare @test as varchar(60) ;
set @test = '10,''john''';
</code></pre>

<p>Now use the variable <code>@test</code> in <code>insert into</code> as </p>

<pre><code>insert into id_test (id,name) values(@test)
</code></pre>

<p>Reason for asking this question is that, I do not want to pass all the variables from web page to a stored procedure.  Instead I want to pass pass one variable from Web page which holds the comma separated values to be inserted into table.  </p>