Viewing 3 posts - 1 through 3 (of 3 total)
In the past I have used PIVOT/ UNPIVOT along side dynamic SQL mainly in ETL scripts.
For example I was importing data that was stored in columns and needed...
August 3, 2012 at 6:45 am
Koen Verbeeck (8/2/2012)
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table A'
INTERSECT
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table B';
You can also use a INNER JOIN instead of INTERSECT to accomplish the same...
August 2, 2012 at 9:42 am
Viewing 3 posts - 1 through 3 (of 3 total)