谁能帮我看一下这段程序哪里有问题????
题目:删除“客户”表数据时引发的DELETE触发器。当删除某条客户信息时,同时删除“订单”表中该客户的所有订单。
go
if exists(select name from sysobjects
where name='delete_kehu'and type='tr')
drop trigger delete_kehu
go
create trigger delete_kehu on 客户
for delete
as
if exists(select *
from deleted
where 订单.客户id=deleted.客户id)
begin
delete 订单
from 订单,deleted
where 订单.客户id=deleted.客户id
end