From 18d6090a7ead8c93d2513e3b034cd1a994ed3c2f Mon Sep 17 00:00:00 2001 From: blowdoof Date: Fri, 18 Oct 2013 16:42:53 +0200 Subject: Bugfix on the sqlsrv forge driver rename_table function --- system/database/drivers/sqlsrv/sqlsrv_forge.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'system/database/drivers/sqlsrv') diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 289dfa6ab..e65e46116 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -241,12 +241,10 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { */ function _rename_table($table_name, $new_table_name) { - // I think this syntax will work, but can find little documentation on renaming tables in MSSQL - $sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name); - return $sql; + return 'EXEC sp_rename '.$this->db->_protect_identifiers($table_name).", ".$this->db->_protect_identifiers($new_table_name); } } -/* End of file mssql_forge.php */ -/* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file +/* End of file sqlsrv_forge.php */ +/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b