T-SQL "UNION" Vs "TABLE variable"

Very recently I learned this. And what a change it has made to all of my SQL based projects! I am sure people who are hardcore SQL programmers would already know this. Thought of sharing this for those who would want to know something interesting. I had a SQL Stored Procedure that is about to retrieve records of a same table from two different databases. The usual approach was something like below: SELECT [column_name_1], [column_name_2], [column_name_3], ... FROM [db_name_1]..[table_name] UNION ...read more
Related
Recommended