BUG: SQL Server Enterprise Manager Creates a Nonclustered Index for a PRIMARY KEY Constraint (315875)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q315875
BUG #: 102200 (sqlbug_70)

SYMPTOMS

If you use SQL Server 7.0 Enterprise Manager to create a PRIMARY KEY constraint, Enterprise Manager creates a unique nonclustered index to implement the primary key if a clustered index does not exist. By default, SQL Server Enterprise Manager creates a unique, clustered index if a clustered index does not exist.

WORKAROUND

To work around this behavior, create the PRIMARY KEY constraint with Transact-SQL statements. Drop the PRIMARY KEY constraint, re-create it with the ALTER TABLE statement, and then specify a clustered index.

For example:
alter table testA drop constraint PK_testA
go
ALTER TABLE testA WITH NOCHECK 
  ADD CONSTRAINT PK_testA PRIMARY KEY  CLUSTERED ( a )
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MajorLast Reviewed:7/18/2002
Keywords:kbbug KB315875