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
518 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
ID: 16923457
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
ID: 16923462
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
ID: 16923543
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

948 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

21 Experts available now in Live!

Get 1:1 Help Now