Suppose I have two tables, t1 and t2 which are identical in layout but which may contain different data.
What\'s the best way to diff these two tables?
For this kind of question I think you have to be very specific about what you are looking for, as there are many ways of interpreting it and many different approaches. Some approaches are going to be too big a hammer if your question does not warrant it.
At the simplest level, there is "Is the table data exactly the same or not?", which you might attempt to answer with a simple count comparison before moving on to anything more complex.
At the other end of the scale there is "show me the rows from each table for which there is not an equivalent row in the other table" or "show me where rows have the same identifying key but different data values".
If you actually want to sync Table A with Table B then that might be relatively straightforward, using a MERGE command.