You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Colin Ritchie (JIRA)" <ji...@apache.org> on 2005/11/26 01:09:56 UTC
[jira] Created: (DDLUTILS-52) MS-SQL errors with "DEFAULT"s in Alter Statements
MS-SQL errors with "DEFAULT"s in Alter Statements
-------------------------------------------------
Key: DDLUTILS-52
URL: http://issues.apache.org/jira/browse/DDLUTILS-52
Project: DdlUtils
Type: Bug
Environment: WinXP, Sql Server 2000, Java 1.4.2
Reporter: Colin Ritchie
Assigned to: Thomas Dudziak
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (DDLUTILS-52) MS-SQL errors with "DEFAULT"s in
Alter Statements
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-52?page=all ]
Thomas Dudziak resolved DDLUTILS-52.
------------------------------------
Resolution: Fixed
Yes, the default has to be added manually via ALTER TABLE ADD CONSTRAINT (and a previous default must be dropped before)
> MS-SQL errors with "DEFAULT"s in Alter Statements
> -------------------------------------------------
>
> Key: DDLUTILS-52
> URL: http://issues.apache.org/jira/browse/DDLUTILS-52
> Project: DdlUtils
> Issue Type: Bug
> Components: Core - SqlServer
> Environment: WinXP, Sql Server 2000, Java 1.4.2
> Reporter: Colin Ritchie
> Assigned To: Thomas Dudziak
> Fix For: 1.0
>
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-52) MS-SQL errors with "DEFAULT"s in
Alter Statements
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-52?page=all ]
Thomas Dudziak updated DDLUTILS-52:
-----------------------------------
Fix Version: 1.0
> MS-SQL errors with "DEFAULT"s in Alter Statements
> -------------------------------------------------
>
> Key: DDLUTILS-52
> URL: http://issues.apache.org/jira/browse/DDLUTILS-52
> Project: DdlUtils
> Type: Bug
> Environment: WinXP, Sql Server 2000, Java 1.4.2
> Reporter: Colin Ritchie
> Assignee: Thomas Dudziak
> Fix For: 1.0
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-52) MS-SQL errors with "DEFAULT"s in
Alter Statements
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-52?page=all ]
Thomas Dudziak updated DDLUTILS-52:
-----------------------------------
Component: Core - SqlServer
> MS-SQL errors with "DEFAULT"s in Alter Statements
> -------------------------------------------------
>
> Key: DDLUTILS-52
> URL: http://issues.apache.org/jira/browse/DDLUTILS-52
> Project: DdlUtils
> Type: Bug
> Components: Core - SqlServer
> Environment: WinXP, Sql Server 2000, Java 1.4.2
> Reporter: Colin Ritchie
> Assignee: Thomas Dudziak
> Fix For: 1.0
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira