Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
MikeWalsh earned 500 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 31

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

636 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