CREATE TABLE #Test1( Test_Text VarChar(20) ); INSERT INTO #Test1(Test_Text)VALUES('abc'),('cde'),('fgh'),('xyz'),('123'),('tln'),('456'),('tprq');DECLARE @P1 VarChar(30);SET @P1 = '''xyz'''+','+'''tln'''+','+'''tprq''';SELECT @P1;EXEC(N'SELECT * FROM #Test1 WHERE Test_Text IN (' + @P1 + ')');
EXEC(N'SELECT * FROM #Test1 WHERE Test_Text IN (' + @P1 + ')');
We walk in the dark places no others will enterWe stand on the bridge and no one may pass