summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorblowdoof <blowdoof@gmail.com>2013-10-18 16:42:53 +0200
committerblowdoof <blowdoof@gmail.com>2013-10-18 16:42:53 +0200
commit18d6090a7ead8c93d2513e3b034cd1a994ed3c2f (patch)
treea2d4eff26360b09fbef20ca1fd26628b5f6747dc /system/database/drivers
parent84b053906da253dbe2fa63a409c2559f3af8ef69 (diff)
Bugfix on the sqlsrv forge driver rename_table function
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php8
1 files changed, 3 insertions, 5 deletions
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