t-sql清空表数据的两种方式示例(truncate and delete)
程序员文章站
2023-12-03 17:41:40
复制代码 代码如下:truncate table (transact-sql)
removes all rows from a table without logging...
复制代码 代码如下:
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快,而且释放日志所占资源,不记录由于删除行的影响所产生的日志。
上一篇: Python3解释器知识点总结
下一篇: SQL字符串处理函数大全