Declare @SQL varchar(max)SET @SQL ='select c.pid,''Not Exists'' as Pstate from( SELECT '''+REPLACE(@JoinID,',',''' pid UNION ALL SELECT ''')+''' pid ) c where c.pid not in (SELECT pn_id FROM pytable )' exec(@SQL) else begin select null as Psatet, null as split end
set v1 'NTR.pytable'; select pn_id from :v1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)