I need to create a stored procedure for comparing two tables. The input parameters are table names (containing schema). Knowing the names of the tables to be compared, I go to INFORMATION_SCHEMA.COLUMNS to get the list of columns for each table.
The problem is that in the database there are tables having columns populated automatically, e.g. 'created_by' and 'created_date'. When comparing the tables I should not pay attention to the differences in these columns if the rest of the data is the same.
Is there a common approach for finding such columns?