本文介绍了截断声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我是sql的初学者,我有一些confusiom abou truncate。我的问题是truncate命令与delete有什么不同?哪一个最适合查询?请帮助我或给我任何链接,我可以了解它。 提前谢谢。解决方案 试试这个, http:// www .technoreader.com /在-Cluncate-and-Delete-in-SQL.aspx 之间的区别[ ^ ] http://www.dotnetspider.com/resources/4408-Difference-between-delete-truncate-command.aspx [ ^ ] 删除表和删除表的截断表命令之间的实际差异是 a)A Trun的cate table 语句的执行速度比删除表快得多。 b)截断表不支持where子句。 c)截断表语句不会触发触发器。使用truncate时,未在事务日志中输入已删除的行。 d)您也不能对删除表使用截断表语句外键约束引用。 它取决于查询哪个更好删除和截断表命令。如果你想删除所有表意味着不想使用表中的选定值那么在这种情况下截断表将是最好的 有关详细信息,请导航给定链接 DELETE和之间的区别TRUNCATE [ ^ ] b $ b 希望它适合你。 Hi,I am a beginner in sql and I have some confusiom abou truncate. My question is how the truncate command is different from delete? Which one is best for query? Please help me or give me any link where I can learn about it.Thanks in advance. 解决方案 Try this,http://www.technoreader.com/Difference-between-Truncate-and-Delete-in-SQL.aspx[^]http://www.dotnetspider.com/resources/4408-Difference-between-delete-truncate-command.aspx[^]The actual difference between Delete and Truncate Table command for delete table is thata) A Truncate table statement is executed much faster than delete table.b) Truncate table does not support the where clause.c) Truncate Table Statement does not fire a trigger. When truncate is used, the deleted rows are not entered in the transaction log.d) You can also not use Truncate Table statement for delete table which is referenced by Foreign key constraint.and it depends upon query which is better between Delete and Truncate Table Command. if you want to delete all table means not want to use selected value from table then in that case Truncate Tablewill be the bestFor more details navigate the given link difference between DELETE and TRUNCATE[^]Hope it will works for you. 这篇关于截断声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-28 03:06