日期:2014-05-18  浏览次数:20383 次

如何写脚本清空多个表
我想写一个sql脚本清空表 table1, table2, table3

请问要如何写这个脚本?

------解决方案--------------------
从sys.objects里找出这些表,

用游标逐个清空.
------解决方案--------------------
SQL code

delete from table1
delete from table2
delete from table3
?

------解决方案--------------------
truncate table table1
truncate table table2
truncate table table3
------解决方案--------------------
探讨

额,会了。。。

truc.sql内容
truncate table1;
truncate table2;
truncate table3;
truncate table4;

楼下来接分