In this post, let us see how to do a simple data comparison without using the TableDiff utility. Remember that this is only for small tables with less columns.
To create some sample data, let us take the Customers table of the Northwind database and create a duplicate of it
Now change some data in the Customers Temp table by using the following query
It's now time to execute our query. I am comparing just 4 columns for changes. Remember as I said, use it on small tables with lesser columns:
Running this query returns the two rows that do not match each other.
Know a better and simpler T-SQL that can do this? Share it here please!