t-sql清空表数据的两种方式示例(truncate and delete)
t-sql清空表数据的两种方式示例(truncate and delete)
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:TRUNCATETABLE(Transact-SQL)Removesallrowsfromatablewithoutlog...

复制代码 代码如下:

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数据库学习
热门mssql数据库学习
编程开发子分类