Solved

'80040e14'   The text, ntext, or image data type cannot be selected as DISTINCT. (None of the Fields Are?)

Posted on 2006-06-16
3
515 Views
Last Modified: 2008-01-09
Hello All;

 I receive the following error through my ASP page.
==============================================
Microsoft OLE DB Provider for SQL Server error '80040e14'

The text, ntext, or image data type cannot be selected as DISTINCT.

/BS/Connections/i_utils.asp, line 51
==============================================

This is the code:
==============================================
==============
sSQL = "SELECT distinct A.*, B.CatID, B.Cat, " & _
        " (SELECT COUNT(1) FROM Cats WHERE A.CatTypeID=Cats.CatTypeID) AS ParentCount, " & _
        " (SELECT COUNT(1) FROM Content WHERE B.CatID=Content.CatID) AS ChildCount " & _
        " FROM (CatTypes A LEFT JOIN Cats B ON A.CatTypeID = B.CatTypeID) " & _
        " LEFT JOIN Content C on B.CatID = C.CatID "
Srs.Open sSQL, Bconn, 1, 3, 1      ' Line 51 is here
==============
==============================================
The FieldName and Data Types are:
CatID = bigint
CatTypeID = int
Cat = varchar

=======
As you can see, none of the Field's Data Types are of "text, ntext (or) Image"

Any idea's on this one?

Thanks All;
Carrzkiss
0
Comment
Question by:Wayne Barron
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
MikeWalsh earned 125 total points
Comment Utility
Well you are doing a select a.*

so what are the columns in the CatTypes? There is a text/ntext or image in one of those columns I am willing to bet.
0
 
LVL 13

Expert Comment

by:MikeWalsh
Comment Utility
script your CatTypes table and show it here. I bet you will see the column right there.
0
 
LVL 30

Author Comment

by:Wayne Barron
Comment Utility
Oh man. That was sweet.

So it was looking at the entire Table of CatTypes. since it was the a.*
I will be darn,
Thanks a bunch.
It was the
CatType - text
I changed it to:
CatType - varchar.

You rock.
Thanks you
Wayne
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now