0
votes

Say I have two records from the same SQL Server table, and I want to see only the columns where the data is not the same between these two records. There are many columns, and the differences are not visually obvious.

Is there a query or keyword I can use to highlight the columns where the data is different?

Example:

Column1 Column2 Column3 Column4 etc...
data1 data30 somedat data etc.
data1 data29 sonedat data etc.

I would want to return:

Column2 Column3 etc...
data30 somedat etc.
data29 sonedat etc.

because Column2 and Column3 are have different values between the two records.

You will have write custom logic to do this. Without anymore information than you provided there isn't much in the way of detail I can offer. - Sean Lange
@SeanLange what can I provide to help? - don4210
Where are you (or your users) looking at the output? In management studio? No. Not unless you write a plugin. In a user interface written by you or another programmer? Write the logic to do the highlighting in the user interface. - allmhuran