These queries are used to compare the data in two tables. In these examples all the rows in each table is retrieved and compared using the UNION ALL command. I would recommend adding additional WHERE criteria for very large tables to reduce the number of rows that will be compared.
These SQL statements are based on a stored procedure from this link:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=23054&SearchTerms=compare,table
A Normalization Primer
For most DBAs, normalization is an understood concept, a bread and butter bit of knowledge. However, it is not at all unusual to review a database design by a development group for an OLTP (OnLine Transaction Processing) environment and find that the schema chosen is anything but properly normalized. This article by Brian Kelley will give you the core knowledge to data model.
2003-01-13
18,614 reads