Sean Pearce (6/26/2013)
Alan.B (6/25/2013)
Which is why I included two solutions: My original solution which I believe is correct and one which was cleaner and faster than the one Michael posted.Do you not test before making performance claims?
Michael Valentine Jones
SQL Server Execution Times:
CPU time = 265 ms, elapsed time = 117 ms.
Alan.B
SQL Server Execution Times:
CPU time = 812 ms, elapsed time = 269 ms.
First, good morning to you too. I am not trying to win a contest here and would like to think we are all on the same team. If I was mistaken it would not be the first time on this forum. That said, perhaps a friendlier tone is in order?
Regarding your question... I would not make performance claims without testing. Can you post the ddl you used to come up with those numbers? What are you comparing to what? I don't have a server handy at the moment but Id like to see how you came up with these results; they were different then mine. I will re-test this later this morning and post my results.
-- Itzik Ben-Gan 2001