Microsoft KB Archive/221659

= FIX: The SQL Server Upsizing Wizard cannot create Primary Key indexes if fields in different tables have duplicate names =

Article ID: 221659

Article Last Modified on 3/18/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q221659



SYMPTOMS
You have a database that has Primary Key indexes in two tables. These indexes have the same field name or the same tag name. After you run the Microsoft SQL Server Upsizing Wizard to upsize the database, you receive the following error message:

Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'f1' in the database.

The wizard could not create the second Primary Key index F1.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Microsoft Visual Studio 6.0 Service Pack 3.



Steps to reproduce the problem
  Run the following code in a program file: #DEFINE DBCNAME 'testdb' #DEFINE TABNAME 'testtab' #DEFINE TABCOUNT    2

CLEAR CLOSE DATABASES ALL DELETE FILE testdb.DBC DELETE FILE testdb.dc?

CREATE DATABASE DBCNAME

FOR lni = 1 TO TABCOUNT DELETE FILE (TABNAME+ALLTRIM(STR(lni)))+'.dbf' DELETE FILE (TABNAME+ALLTRIM(STR(lni)))+'.cdx' CREATE TABLE (TABNAME+ALLTRIM(STR(lni))) (F1 C(10) NOT NULL ;       PRIMARY KEY, F2 C(10) NOT NULL) ENDFOR

ALTER TABLE (TABNAME+ALLTRIM(STR(lni-2))) ADD FOREIGN KEY TAG ; F1 REFERENCES (TABNAME+ALLTRIM(STR(lni-1))) TAG F1                    Run the SQL Server Upsizing Wizard. Select the database that you created in step 1, and then click Next. In step 2 of the Upsizing Wizard, select an ODBC data source that you can upsize to on a computer that is running SQL Server. Log on to the server. In step 3 of the Upsizing Wizard, select both tables. In the Upsizing Wizard, click Finish, and then click Finish again. When the upsizing process has completed, a project appears. To see the error message that is mentioned in the "Symptoms" section, preview the report Rpterrs in the project.

Note This report may be named Rpterrs1.</li></ol>

Additional query words: KBDSE

Keywords: kbbug kbfix kbdatabase kbwizard kbvs600sp3fix KB221659

-

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

© Microsoft Corporation. All rights reserved.