Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 27th, 2010, 07:36 AM
Authorized User
 
Join Date: Aug 2007
Location: , Tamil Nadu, India.
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Red face UNION in SQL

Why Union is not accept image?
where as union all accept that.
  #2 (permalink)  
Old July 27th, 2010, 07:43 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Because UNION (without ALL) deduplicates and to do this it has to compare data which it can't do for IMAGE type fields. Just as you can't sort on such types.
__________________
Joe
http://joe.fawcett.name/
  #3 (permalink)  
Old July 27th, 2010, 07:43 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I think because a UNION uses DISTINCT to filter out duplicate rows. DISTINCT is not supported for types such as Image.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #4 (permalink)  
Old July 27th, 2010, 02:16 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

LOL!!! Man, do you guys run a race to see who posts the fastest?? Too bad the post times don't show down to the millisecond. <grin/>


Similar Threads
Thread Thread Starter Forum Replies Last Post
UNION QUERY Help Corey Access 1 October 27th, 2006 05:29 PM
UNION query. rupen Access 3 April 28th, 2006 02:49 AM
SQL-Union works in Access but not in Jet tonatwinemaker Access ASP 5 February 20th, 2006 04:37 PM
Union joins in SQL sellis Access 3 April 7th, 2004 12:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.