mister.magoo (5/30/2014)
Aside from having a working solution, do you understand why your query was wrong?You cannot reference a table variable in the same way you do a table, you MUST use an alias as in Jason's code if you want to prefix a column.
Good point and thanks for following up on that.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events