C
cumtdog
Unregistered / Unconfirmed
GUEST, unregistred user!
在SQLSERVER7.0中
就是不触发??为什么啊,我设置了外键啊,而且也级联删除复选框也打钩了啊
CREATE TRIGGER deletedwsd
ON dwbd
FOR DELETE
AS
declare @yf char(2),
@nf char(4),
@nbzh char(6)
select @yf=a.yf,@nf=a.nf,@nbzh=a.nbzh from dwbd a,deleted b
where a.nbzh=b.nbzh and a.yf=b.yf and a.nf=b.nf
print "delete!!haha "
if exists
(select * from dwsd
where nbzh=@nbzh and yf=@yf and nf=@nf)
begin
print "exist"
delete from dwsd
where nbzh=@nbzh and yf=@yf and nf=@nf
end
就是不触发??为什么啊,我设置了外键啊,而且也级联删除复选框也打钩了啊
CREATE TRIGGER deletedwsd
ON dwbd
FOR DELETE
AS
declare @yf char(2),
@nf char(4),
@nbzh char(6)
select @yf=a.yf,@nf=a.nf,@nbzh=a.nbzh from dwbd a,deleted b
where a.nbzh=b.nbzh and a.yf=b.yf and a.nf=b.nf
print "delete!!haha "
if exists
(select * from dwsd
where nbzh=@nbzh and yf=@yf and nf=@nf)
begin
print "exist"
delete from dwsd
where nbzh=@nbzh and yf=@yf and nf=@nf
end