saifmahatab (5/5/2014)
Thanks but its not working..I tried I need to create a temp table where it stores the timing of a select query that I have takes time to run
Sean's script works for me. Post yours, we'll see what's wrong.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden