网络编程
位置:首页>> 网络编程>> 数据库>> t-sql清空表数据的两种方式示例(truncate and delete)

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

  发布时间:2024-01-20 09:46:24 

标签:t-sql,清空表数据,truncate


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

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com