ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved. Pass comma separated variable to IN clause in SQL Server<p>Hi <a class="username" rel="jon"> jon</a>,</p> <p>Refer below link to split value using comma.</p> <h1 class="header"><a title="Insert Comma Separated (Delimited) values in a Table in SQL Server'a" href="">Insert Comma Separated (Delimited) values in a Table in SQL Server</a></h1> <p>Refer below query.</p> <p><span style="text-decoration: underline;"><strong>SQL</strong></span></p> <pre class="brush: sql">DECLARE @Lines AS NVARCHAR(MAX) SET @Lines = &#39;USA,UK&#39; SELECT * FROM Customers WHERE Country IN ( SELECT Item FROM SplitString(@Lines,&#39;,&#39;))</pre> <p>&nbsp;</p>, 05 Jul 2019 03:34:29 GMT