I have some tables having 10 to 30 rows. Now I am considering two rows from a table. I need to compare these rows & show the list of column name which values are different. Then I will highlight those columns in my website to show my viewer that these values are changed.

Eample is:

| Id | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | 5 | dog | abc | bob | us | fff |
| 2 | 4 | cat | abc | bob | me | fff |

Output :

| Changed\_ColumnName |
| --- |
| Col1 |
| Col2 |
| Col5 |

Now the problem is:

1. It is not a good way to compare each & every column & give the output. Again I want to create a common stored procedure for all my tables where I will give the table name & two Column ID & it will do the same. how it can be achieved? because number of table column are not same & column name are not same.
I saw other questions but they are suggesting to compare every column with other column for one table. No solution for multiple table with single Stored Procedure. Again, if the number column is more, then comparing each column is not a good idea. Can anyone suggest a better way ?
2. The purpose of this work is to show the user of my website about the changes of his previous record & latest record with highlighting the column that are changed. So, is it a good way to do it in above SQL approach? or taking two record as list of model & compare them in backend using C# or java will be a better solution ? If yes, then how ? without comparing each & every column.