Skip to content

Loading…

DBAL-254: SQL Server rename table should use sp_RENAME #1431

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user fredcallagan:

Whenever DBAL Schema Manager tries to rename a table in sql server 2008 it should use also the sp_RENAME procedure. Otherwise error is thrown.

Apparently a similar issue was fixed for column ALTER Commands as described in the link below, but also the ALTER TABLE command should use sp_RENAME to avoid crash.

http://www.doctrine-project.org/jira/browse/[DBAL-199](http://www.doctrine-project.org/jira/browse/DBAL-199)?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel

Suggested fix for Latest DBAL 2.2

From Line 283:

$queryParts[] = 'RENAME TO ' . $diff->newName;

To Line 283:

$sql[] = 'sp_RENAME \'' . $diff->name . '\',\'' . $diff->newName.'\'';

This seems to fix the problem.

Hope this helps

Sorry for my bad english.

Fredcallagan

@doctrinebot

Comment created by @beberlei:

Fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.