DBAL-199: MSSQL change column name #1370

Closed
doctrinebot opened this Issue Nov 15, 2011 · 4 comments

2 participants

@doctrinebot

Jira issue originally created by user dv3000:

Hello,

to create a schema for mssql works ok, but to alter the name of a column, use the SQL command "CHANGE" and Mssql not recognize this command.
to alter the name of a column in MSSQL you should use the store procedure "sp_rename"

http://msdn.microsoft.com/en-us/library/ms188351.aspx

Do not know if I'm doing something the wrong way, but the command "php app \ console doctrine: schema: update" does not work by altering the name of the column

sorry my english it's very poor

@doctrinebot

Comment created by fredjiles:

I get this error as well. Just trying to change a field from nvarchar(40) to nvarchar(60) outputs this sql
ALTER TABLE offense_extension CHANGE disposition disposition NVARCHAR(60) DEFAULT NULL

It should be ALTER TABLE offense_extension ALTER COLUMN disposition NVARCHAR(60) NULL

@doctrinebot

Comment created by @beberlei:

This is fixed in another ticket i just realized and is included in the latest 2.1 DBAL release.

@doctrinebot

Issue was closed with resolution "Duplicate"

@doctrinebot

Comment created by pidikun:

This problem still exists.

Here are some of the sql lines generated with :

ALTER TABLE msrs CHANGE Temp27 Temp27 SMALLINT NOT NULL;
ALTER TABLE batches CHANGE status status BIT DEFAULT NULL;

Doctrine DBAL Version: 2.1.7
MSSQL 2008 R2

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment