This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Dialog box displaying error.

SQL SERVER – UNION With TEXT DataType Returns Error but and UNION ALL Works – Reasons

January 3, 2015
Pinal Dave
SQL Tips and Tricks
SQL Union clause

Why does UNION with TEXT datatype return an error while UNION ALL works? It comes down to how UNION removes duplicate rows. Here is the reason.

Read More
SQL union error dialog.

SQL SERVER – UNION and UNION ALL with TEXT DataType – Observation

December 30, 2014
Pinal Dave
SQL Tips and Tricks
SQL Union clause

UNION fails on a TEXT column with Msg 5335, yet UNION ALL with TEXT datatype works fine. Here is the code so you can try the difference yourself.

Read More
Wool skeins on a table, one heap swept together and another sorted to remove repeats.

UNION vs UNION ALL: Reading the Operators Each One Adds to a Plan

October 19, 2013
Pinal Dave
SQL Performance
Execution Plan, SQL Server, SQL Union clause

Compare UNION vs UNION ALL through actual plans, duplicate-removal operators, memory grants and reads, then prove when branches cannot overlap.

Read More
Veneer packets beside one aligned marquetry band and an unused duplicate strip

Set Operator Rules: Column Names, Types and ORDER BY With UNION

September 18, 2013
Pinal Dave
SQL Tips and Tricks
SQL Operator, SQL Server, SQL Union clause

Why did my UNION change its headers, fail on a word, or sort wrong? Small examples show each rule and the error it produces.

Read More
SQL SERVER - Simple Puzzle with UNION - Part 5

SQL SERVER – Simple Puzzle with UNION Part 5

September 11, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Union clause

In Puzzle with UNION Part 5, the final part, two almost identical queries return the same answer, yet their execution plans are very different. Why?

Read More
Sql server execution plan.

SQL SERVER – Simple Puzzle with UNION Part 4

September 10, 2013
Pinal Dave
SQL Tips and Tricks
SQL Union clause

Puzzle with UNION Part 4 is for readers who want to think: three queries using UNION, a subquery and NOT EQUAL TO return the same result. Compare their plans.

Read More
SQL SERVER - Simple Puzzle with UNION - Part 3

SQL SERVER – Simple Puzzle with UNION Part 3

September 9, 2013
Pinal Dave
SQL Tips and Tricks
SQL Union clause

Simple Puzzle with UNION Part 3 has three T-SQL scripts on the UNION clause, and only one is correct. Can you spot it without running them in Management Studio?

Read More
Previous 1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com