• If someone asks you how to do something, it is usually best to just provide the correct answer. Most people get confused if you first explain the wrong way and then the correct way. Sure if I see a questionable code in a review then I would explains the pros and cons for the various methods. But now that we have figured this really complicated issue of how to count the rows in a result can someone explain something very simple. (Assuming MS SQL 2008+) When is it better to use a temporary table vs a declared table? Also when is it better to use a LEFT OUTER JOIN vs. (NOT EXISTS sub query) to determine rows that are missing from one table based on another table (i.e. Parent without Children)?