Late last Friday afternoon I was working on a database quality issue that had been challenging me all day. Essentially I was looking for any distraction that would give the left side of my brain a break. These two gents came up to me with a somewhat coy look on their faces and after the usual courtesies along the lines of “Do you have a minute for a SQL question? The best way to understand WHY the SQL engine returned 10 is to look at the query plan: When reading graphical execution plans we always read from RHT to LEFT. ” proposed the following question: Come on guys, I was hoping for a ping pong or foosball invite… Regardless, I couldn’t help myself and proceeded to give it some thought. The first step the SQL engine does is a table scan on our temp table. there’s only 10 rows in it, there are no indexes, and SQL probably wouldn’t use an index anyway since the data set is so small. The above diagram hhts the pop up box when hovering the cursor over the line that connects the table scan with the stream aggregate (in our case, the only aggregate function is COUNT). I do not know ho whether many of you have ever had this problem but as I was working on quite a lot of excel data, transforming it for placing in a database using local in file, you will occasionally find that there is data in excel that you may need to represent as a number to enable table linking and foren keys. For the longest time, I was converting data for foren keys either manually or using an application of database procedure to create these foren keys. This worked fine until I got many excel sheets that were not similarly formatted.