这个交易怎么写?
我的意思是一旦删除@zcl,将相关的几个表同时删除
CREATE PROCEDURE delete_zcl
@zcl varchar(20)
AS
if @zcl is not null
begin
begin transaction
delete from cb_djb where zcl=@zcl --可能不存在zcl=@zcl的记录
delete from cb_header where zcl=@zcl
delete from djb where zcl=@zcl
delete from dibparent where zcl=@zcl
if @@ERROR!=0
begin
ROLLBACK transaction
end
commit tran
end
GO