BUG: Query Analyzer May Allow an Invalid Seed Number During Table Creation (276374)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q276374
BUG #: 58514 (SQLBUG_70)

SYMPTOMS

With Microsoft SQL Query Analyzer, you may be allowed to enter an invalid (overflowed) identity seed value when you create a table. After the table is created, SQL Query Analyzer also allows you to insert rows. After you enter the data with Query Analyzer, you cannot do either of the following from SQL Server Enterprise Manager (SEM):
  1. View the table design. -or-

  2. View the database diagram.
After errors occur in situations a. or b., you may not be able to access any database in SEM.

If you create the same table from SEM, the following behavior occurs:
  • When you save the table, the number is automatically corrected to 2147483647 if the identity seed number entered is invalid (for example, entered 151,000,000,000).

WORKAROUND

To work around this, use the following steps:
  1. Create the table with SQL Server Enterprise Manager, and then manually define the data type, identity column, id seed, and so forth.
  2. Save the table, and note that it is automatically corrected to 2147483647 if the identity seed number entered is invalid (for example, entered 151,000,000,000).
  3. Use Transact-SQL to set the identity column length and the seed value to a valid number.

    For additional references, see the DBCC CHECKIDENT (T-SQL) topic in SQL Server Books Online.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbDSupport KB276374