Try something like this:DECLARE @stmt VARCHAR(MAX) = STUFF((SELECT ' UNION' + ' SELECT ' + B.COLUMN_NAME + ' FROM ' + A.TABLE_SCHEMA + '.' + A.TABLE_NAME FROM INFORMATION_SCHEMA.TABLES AS A INNER JOIN INFORMATION_SCHEMA.COLUMNS AS B on A.TABLE_NAME = B.TABLE_NAME WHERE B.COLUMN_NAME like '%parameter' ORDER BY A.TABLE_NAME, B.COLUMN_NAME FOR XML PATH('')), 1, LEN(' UNION'), '');EXECUTE(@stmt);
For us, there is only the trying. The rest is not our business. ~T.S. EliotMuhammad Al Pasha