UNION vs. UNION ALL in SQL Server

Sometimes there is a need to combine data from multiple tables or views into one comprehensive dataset. This may be for like tables within the same database or maybe there is a need to combine like data across databases or even across servers. I have read about the UNION and UNION ALL commands, but how do these work and how do they differ?

Blogs

New Power BI Report Design Pre-Con in 2020

By

I’m excited to announce that I will be offering a full-day pre-con about Power...

Resetting an Azure SQL Database Admin Password

By

This is likely something that most people know, but it was a bit confusing...

Read the latest Blogs

Forums

Deadlocks

By Admingod

Looking for some ideas so to prevent deadlocks. I have captured queries that constantly...

Lengthy query response times

By bob-596435

I'm dealing with a strange problem that started today. A simple query that will...

Query runs for days when upgrading to 2017

By askcoffman

We upgraded our datawarehouse sql server from 110 to 140, RTM - CU17. In...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers