declare @col1 varchar(1000)
declare @col2 varchar(1000)
set @col1='34,67,89,36'
set @col2='123.456.89.980'
set @col1=' select id=' + replace(@col1,',',' union all select ')
set @col2=' select id=' + replace(@col2,'.',' union all select ')
set @col1=' select b.* from (' + @col1 + ') a right join (' + @col2 + ') b on a.id=b.id where a.id is null '
declare @col2 varchar(1000)
set @col1='34,67,89,36'
set @col2='123.456.89.980'
set @col1=' select id=' + replace(@col1,',',' union all select ')
set @col2=' select id=' + replace(@col2,'.',' union all select ')
set @col1=' select b.* from (' + @col1 + ') a right join (' + @col2 + ') b on a.id=b.id where a.id is null '
exec(@col1)