首页 > 数据库技术 > 详细

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

时间:2016-02-07 17:09:03      阅读:154      评论:0      收藏:0      [点我收藏+]

复制代码 代码如下:

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

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

原文:http://www.jb51.net/article/43883.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!