ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. 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="https://www.aspsnippets.com/Articles/Insert-Comma-Separated-Delimited-values-in-a-Table-in-SQL-Server.aspx">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>https://www.aspforums.net:443/Threads/145355/Pass-comma-separated-variable-to-IN-clause-in-SQL-Server/https://www.aspforums.net:443/Threads/145355/Pass-comma-separated-variable-to-IN-clause-in-SQL-Server/Fri, 05 Jul 2019 03:34:29 GMT