加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

t-sql清空表数据的两种方式示例(truncate and delete)

发布时间:2020-12-12 09:25:02 所属栏目: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 syst

代码如下: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快,而且释放日志所占资源,不记录由于删除行的影响所产生的日志。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读