t-sql清空表数据的两种方式示例(truncate and delete)
时间:2021-01-22 12:25:34|栏目:MsSql|点击: 次
复制代码 代码如下:
TRUNCATE TABLE (Transact-SQL)
Removes all rows from a table without logging the individual row deletions.
TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause;
however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.
两者的区别在于Truncate快,而且释放日志所占资源,不记录由于删除行的影响所产生的日志。
上一篇:查询存储过程中特定字符的方法
栏 目:MsSql
本文标题:t-sql清空表数据的两种方式示例(truncate and delete)
本文地址:http://www.codeinn.net/misctech/49134.html