DdlUtils
  1. DdlUtils
  2. DDLUTILS-52

MS-SQL errors with "DEFAULT"s in Alter Statements

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0 RC1
    • Component/s: Core - SqlServer
    • Labels:
      None
    • Environment:
      WinXP, Sql Server 2000, Java 1.4.2

      Description

      When the using the ant task writeSchemaToDatabase with SQL Server 2000 to a database already created, the columns with the default attribute report an error:

      [ddlToDatabase] SQL Command ALTER TABLE "oci_switch"
      [ddlToDatabase] ALTER COLUMN "schd_status" SMALLINT DEFAULT '0' NOT NULL failed with [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'DEFAULT'.

      Schema:
      <table name="oci_switch">
      <column name="schd_status" primaryKey="false" required="true" type="SMALLINT" size="6" default="0" autoIncrement="false"/>
      </table>

      I believe in MS SQL, you cannot include a DEFAULT in an ALTER COLUMN. It is a seperate statement.

        Activity

          People

          • Assignee:
            Thomas Dudziak
            Reporter:
            Colin Ritchie
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development