BUG: Confusing Error Message w/ CREATE UNIQUE NONCLUSTERED INDEX

Last reviewed: September 23, 1997
Article ID: Q168659
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 15660 (NT: 6.5)

SYMPTOMS

In SQL Server 6.5, you will receive a message 1505 when duplicate values exist in a column and you attempt to create a unique index on that column. In versions of SQL Server 6.5 earlier than Service Pack 3, the message was a bit confusing:

   Msg. 1505, Level 16, State 1
   Create unique index aborted on duplicate key.  Primary key is 'type 3c,
   len 8'

However, beginning in SQL Server 6.5 Service Pack 3, SQL Server indicates the duplicate value that the CREATE INDEX command aborted on:

   Msg 1505, Level 16, State 1
   Create unique index aborted on duplicate key.  Primary key is '12'

WORKAROUND

Identify the duplicate column values that make up the index and remove them before issuing the CREATE UNIQUE NONCLUSTERED INDEX statement.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been fixed in Service Pack 3 for Microsoft SQL Server version 6.5. You can download Service Pack 3 from the Web site at http://www.microsoft.com/sql/ServicePak.htm.

MORE INFORMATION

For more information, see the CREATE INDEX statement in the T-SQL Reference Manual or the SQL Server Books Online.

Keywords          : kbbug6.50 SSrvTran_SQL kbusage
Version           : 6.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbservicepack


================================================================================


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: September 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.