#tbloutput

jirikiha@diasp.org

Huh, I've gotten a little too comfortable with the small test sites and forgot about a simple update to make SQL procedures much faster.
CREATE TABLE #tblOutput
instead of DECLARE @tblOutput TABLE
For larger datasets, the temp table outperforms the table variable by a significant margin. From minutes to less than a second in my case. Hopefully, I'll remember next time.
#SQL