求触发器,偶是新手
问题是这样的
表1名:tz(储存帖子用的)
id 自动编号
name 文本
txt 文本
表2名:tzhf(储存帖子回复用的)
id 自动编号
tid 数字[也就是对应帖子的ID]
txt 文本
需要的是删除表tz时候同时删除表tzhf中的tid=id
也就是删除一个帖子同时删除相关的回复!数据库SQL2000
语言ASP
------解决方案--------------------少打了两个
create tigger delete_tzhf
on tz
for delete
as
begin
delete from tzhf where tzhf.tid exists(select id from deleted)
end
------解决方案--------------------create tigger delete_tzhf
on tz
for delete
as
begin
delete from tzhf where tzhf.tid in (select id from deleted)
end