Knowledge Base

FIX: ALTER TABLE ADD PK May Take a Long Time Even With No Data

Article ID: 159848

Article Last Modified on 10/3/2003


APPLIES TO


This article was previously published under Q159848
BUG #: 15900 ()

SYMPTOMS

If there are thousands of tables with hundreds of columns each, the ALTER TABLE ADD PK command may take a long time, even if there is no data in the table.

MORE INFORMATION

ALTER TABLE ADD PK searches syscolumns several times and scans the tables. With thousands of wide tables, it may take a full minute to add a PK to an empty table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

Keywords: kbbug kbfix kbprogramming KB159848