Microsoft KB Archive/260344

= SQL Server 7.0 upgrade might fail if SQL Server 6.5 databases have more than 32,000 tables =

Article ID: 260344

Article Last Modified on 12/17/2004

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q260344



BUG #: 57850 (SQLBUG_70)



SYMPTOMS
When you use the Microsoft SQL Server 7.0 Upgrade Wizard to upgrade a Microsoft SQL Server 6.5 database that has more than 32,000 tables, the upgrade might fail with the following error message:

Error #457

This Key is already associated with an element of this collection.



WORKAROUND
Use Data Transformation Services (DTS) and select a subset of tables at a time to transfer the data from SQL Server 6.5 to SQL Server 7.0.



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



MORE INFORMATION
To reproduce the error message, follow these steps:   In SQL Server 6.5 create a new database with a database device of 1 GB in size and a log device of 512 MB in size.

For example: Create Database upgrade_repro On Device1 = 1024 Log On Device2 = 512   Create 33,000 tables in the database upgrade_repro. You can create a stored procedure to automate the creation of these tables. For example: CREATE PROCEDURE create_tables(@tables int) AS declare @i int, @str VARCHAR(100) SELECT @i = 0 while ( @i < @tables ) BEGIN SELECT @str = 'CREATE TABLE tab' + convert(char(6), @i) + '(c1 int, c2 char)' PRINT @str EXEC(@str) SELECT @i = @i + 1 END GO

exec create_tables 33000  Select the Upgrade Wizard and follow all the instructions the wizard presents you. When you reach the Upgrade Wizard screen that prompts you to choose the database to upgrade, choose the database you created in step 1. When you click the Next button in the Upgrade Wizard screen another screen opens that contains the error message described in the &quot;Symptoms&quot; section of this article.</li></ol>

Keywords: kbbug kbcodesnippet kbpending KB260344

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.