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



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

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.

MORE INFORMATION

Steps to reproduce the problem

  1. 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
    					
  2. Run the SQL Server Upsizing Wizard. Select the database that you created in step 1, and then click Next.
  3. 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.
  4. In step 3 of the Upsizing Wizard, select both tables.
  5. In the Upsizing Wizard, click Finish, and then click Finish again.
  6. 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.

Modification Type:MajorLast Reviewed:3/18/2005
Keywords:kbBug kbDatabase kbfix kbVS600sp3fix kbwizard KB221659