diff options
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/drivers/mssql/mssql_driver.php | 18 | ||||
-rw-r--r-- | system/database/drivers/sqlsrv/sqlsrv_driver.php | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index b1d2716ba..055c9decb 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -466,6 +466,24 @@ class CI_DB_mssql_driver extends CI_DB { // -------------------------------------------------------------------- /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * + * If the database does not support the truncate() command, + * then this method maps to 'DELETE FROM table' + * + * @param string the table name + * @return string + */ + protected function _truncate($table) + { + return 'TRUNCATE TABLE '.$table; + } + + // -------------------------------------------------------------------- + + /** * Delete statement * * Generates a platform-specific delete string from the supplied data diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index dd55d7e1d..f75024799 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -453,6 +453,24 @@ class CI_DB_sqlsrv_driver extends CI_DB { // -------------------------------------------------------------------- /** + * Truncate statement + * + * Generates a platform-specific truncate string from the supplied data + * + * If the database does not support the truncate() command, + * then this method maps to 'DELETE FROM table' + * + * @param string the table name + * @return string + */ + protected function _truncate($table) + { + return 'TRUNCATE TABLE '.$table; + } + + // -------------------------------------------------------------------- + + /** * Delete statement * * Generates a platform-specific delete string from the supplied data |