A simple example of UNION and UNION ALL with two table variables. UNION removes the duplicate rows, while UNION ALL keeps every row from both tables.
SQL SERVER – Guidelines and Coding Standards Complete List Download
My coding standards complete list for SQL Server, cut to what people follow: naming, formatting, and the rules that prevent real bugs.
SQL SERVER – Guidelines and Coding Standards Part 1
Guidelines and Coding Standards Part 1: Pascal naming for tables, and naming patterns for stored procedures, triggers, indexes and keys.
Cursor and Join Questions: SQL Server Interview Answers Part 2
This is part 2 of my SQL Server interview series, with cursor and join questions and seven more. The answers cover collation, functions, subqueries, keys, identity and data warehousing. Each answer is short, with a link to a longer post where one exists.
SQL SERVER – 2008 – Introduction to Merge Statement – One Statement for INSERT, UPDATE, DELETE
The SQL Server 2008 Merge Statement does INSERT, UPDATE and DELETE in one statement and reads the data only once. An introduction to how it works and its syntax.
SQL SERVER – EXCEPT Clause in SQL Server is Similar to MINUS Clause in Oracle
Is there a MINUS clause in SQL Server like in Oracle? Yes, EXCEPT returns the rows of the first query that are not in the second. Example included.
SQL SERVER – 2005 – Difference Between INTERSECT and INNER JOIN – INTERSECT vs. INNER JOIN
What is the difference between INTERSECT and INNER JOIN? Both can return common rows, and AdventureWorks examples show how the two compare.






