I have to find out the name of columns which have different data in a source except target query.
Currently when I am executing a Source except Target query, Even if there is only one column value is different, it's returning entire row. My requirement is to find out names of such columns which have data difference and put them into a separate table.
For example if I have a table as below:
Select * from A;
Col1 Col2 Col3 Col4
1 A India Delhi
2 A US Newyork
when I Query:
Select * from A where Col1=1
except
select * from A where Col1=2
It will display:
Col1 Col2 Col3 Col4
1 A India Delhi
However I need to populate Col1 (Key field) value and Col3,Col4 names(Column names, which were not found to be same at the time of except query execution) into a new table.