BUG: CREATE TABLE Allows More Than 31 FOREIGN KEYs

Last reviewed: January 21, 1998
Article ID: Q137431

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG# NT: 11130 (6.00)

SYMPTOMS

The documented limit on FOREIGN KEYs for a single table is 31, yet the CREATE TABLE statement will allow a table to be created with more than 31 FOREIGN KEYs.

WORKAROUND

Do not create a table with more than 31 FOREIGN KEYs.

If you need to enforce more than 31 primary-foreign key relationships, encode trigger logic on either or both the parent and child tables.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The documented limit on the number of FOREIGN KEYs that reference other tables is 31. If you create a table that has more the 31 such FOREIGN KEYs, attempts to insert to that table will result in an error 431:

   Too many tables in query.


Additional query words: sql6 reference 431 create table
Keywords : kbbug6.00 SSrvProg kbprg
Version : 6.0
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: January 21, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.