日期:2014-05-18 浏览次数:20446 次
--清空所有数据 --反之不行 delete from t3 go delete from t2 go delete from t1 select t2.ID,t3.ID from t1,t2,t3 where t1.name='collage'
------解决方案--------------------
先删除从表数据
再删除主表数据
一级级删
------解决方案--------------------
sysreferences
或
sysforeignkeys
可找出外健表..
--楼主的应该这个顺序和条件删除
delete t3
from
t
join
t2 on t.ID=t2.t1ID and t.Name='collage'
join
t3 on t3.ID=t2ID
delete t2
from
t
join
t2 on t.ID=t2.t1ID and t.Name='collage'
delete t2
from
t
where
Name='collage'