FIX: SQL Upsizing Wizard - UW Fails to Create PK Indexes if Fields in Different Tables have Duplicate Names

ID: Q221659


The information in this article applies to:


SYMPTOMS

After upsizing a database that had primary key indexes in two tables with the same field and or tag name, the following error occurs:

Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'f1' in the database.
The second Primary Key index "F1" could not be created.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug has been fixed in Visual Studio 6.0 Service Pack 3.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code in a program file:


  2. 
       #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 
  3. Run the SQL Server Upsizing Wizard. Select the database you just created and then press the Next button.


  4. In the Upsizing Wizard step 2, select an ODBC datasource to a SQL server to which you can upsize and then log on to the server.


  5. Select both tables in the Upsizing Wizard step 3.


  6. In Upsizing Wizard, select Finish and then select Finish again.


  7. When upsizing is complete, a project appears. To see the error listed at the beginning of this article, preview the report "rpterrs" (this report may be named rpterrs1) in the project.


Additional query words: KBDSE


Keywords          : kbwizard kbDatabase kbVFp600 kbVFp600bug KbDBFDBC kbVS600sp3fix kbGrpFox kbDSupport 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: July 1, 1999