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

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


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
0
投稿

猜你喜欢

  • Python使用psutil获取进程信息的例子

    2021-11-03 07:29:47
  • SqlServer开发神器'SQLPrompt'插件的使用详解

    2024-01-23 23:48:55
  • Python实现桌面翻译工具【新手必学】

    2021-03-27 08:32:47
  • 情人节快乐! python绘制漂亮玫瑰

    2021-02-07 18:22:48
  • 用函数模板,写一个简单高效的 JSON 查询器的方法介绍

    2024-04-18 10:53:00
  • Pyqt实现简易计算器功能

    2022-05-10 13:00:51
  • 在thinkphp5.0路径中实现去除index.php的方式

    2024-05-11 09:54:34
  • Python 编程速成(推荐)

    2021-04-03 04:30:10
  • Go语言开发框架反射机制及常见函数示例详解

    2024-02-16 17:23:19
  • python实现的汉诺塔算法示例

    2023-09-21 11:28:17
  • Python数据分析pandas模块用法实例详解

    2023-01-25 00:47:29
  • Python解释器及PyCharm工具安装过程

    2021-02-23 08:21:51
  • pygame游戏之旅 添加碰撞效果的方法

    2022-11-04 06:45:46
  • 深入剖析Go语言编程中switch语句的使用

    2024-02-19 16:50:45
  • 09七夕节各大搜索引擎LOGO欣赏

    2009-08-27 15:34:00
  • keras 自定义loss损失函数,sample在loss上的加权和metric详解

    2021-06-03 08:11:33
  • sqlserver 查询数据库大小的方法

    2012-08-21 10:22:10
  • python事件驱动event实现详解

    2021-07-27 21:17:04
  • pycharm中创建sql文件及模板的过程

    2021-10-01 14:50:51
  • php实现表单多按钮提交action的处理方法

    2024-05-11 10:10:27
  • asp之家 网络编程 m.aspxhome.com