db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Ritchie (JIRA)" <j...@apache.org>
Subject [jira] Created: (DDLUTILS-50) FK Constraints Failing on Merge in MS-SQL
Date Fri, 25 Nov 2005 23:41:56 GMT
FK Constraints Failing on Merge in MS-SQL

         Key: DDLUTILS-50
         URL: http://issues.apache.org/jira/browse/DDLUTILS-50
     Project: DdlUtils
        Type: Bug
 Environment: WinXP Pro, SQL Server 2000, Java 1.4.2
    Reporter: Colin Ritchie
 Assigned to: Thomas Dudziak 

Re-running the writeSchemaToDatabase task on an existing MS-SQL database causes errors on
all the foreign-key nodes, reporting the error "There is already an object named 'name' in
the database".

Snippet of my schema:

<table name="oci_schedules">
  <column name="schd_m_id" primaryKey="false" required="true" type="INTEGER" default="0"
  <foreign-key foreignTable="oci_schedule_modes">
    <reference local="schd_m_id" foreign="schd_m_id"/>

<table name="oci_schedule_modes">
  <column name="schd_m_id" primaryKey="true" required="true" type="INTEGER" autoIncrement="true"

[ddlToDatabase] SQL Command ALTER TABLE "oci_schedules"
[ddlToDatabase]     ADD CONSTRAINT "oci_schedules_FK_schd_m_id_oci_schedule_modes" FOREIGN
KEY ("schd_m_id") REFERENCES"oci_schedule_modes" ("schd_m_id") failed with [Microsoft][SQLServer
2000 Driver for JDBC][SQLServer]There is already an object named 'oci_schedules_FK_schd_m_id_oci_schedule_modes'
in the database.

I have tried this using the open source JTDS 1.1, with the same error message.  I have also
tried specifying the foreign key name in the XML node, with the same result.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message