INF: Cannot SELECT DISTINCT * on a Table w/ Text/Image Column

Last reviewed: April 10, 1997
Article ID: Q162032
The information in this article applies to:
  • Microsoft SQL Server, version 6.5

SUMMARY

SQL Server 6.5 no longer allows a 'SELECT DISTINCT * FROM <table>' if that table has a text/image column. If you attempting to perform such a query, you will receive the following error message:

   Msg 8163: Text/Image datatype cannot be selected as DISTINCT.

Earlier versions of SQL Server treated this as a valid query if the table contained a unique index or primary key, whose existence would guarantee that the row was distinct. In the presence of such an index, the following message would have been raised:

   Msg 421: TEXT and IMAGE datatypes may not be selected as DISTINCT.
   SQL Server has never allowed a DISTINCT operation on an individual text
   or image column.


Additional query words: sql60 sql65 error
Keywords : kbusage SSrvProg SSrvTran_SQL
Version : 6.5
Platform : WINDOWS
Issue type : kberrmsg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.