wikkel de dynamische query in een IF-blok dat test of de query iets oplevert.
select 'if exists (' + QUERY + ')' + char(10) + ' ' + QUERY
from (
select QUERY = 'select * from ' + TABLE_NAME
+ ' where ' + COLUMN_NAME + ' = 123'
from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME like '%columnOfInterest%'
) q