---事务
if exists(select * from sysobjects where name='usp_deletezichan')
drop proc usp_deletezichan
go
create proc usp_deletezichan
 @leibieId int
as
    begin tran --开始事务
    declare @errorSum int  
    set @errorSum=0 
    --资产
delete from zc where ZiChanLeiBieId=@leibieId
    set @errorSum+=@@ERROR
    --资产类别
delete from zclb where ZiChanLeiBieId=@leibieId
    
    set @errorSum+=@@ERROR
    if @errorSum<>0  
    begin
        print '失败,回滚事务!'
        rollback tran
    end
    else
      begin
      print '成功,提交事务!'
        commit tran
    end
go
说是消息 170,级别 15,状态 1,过程 usp_deletezichan,第 9 行
第 9 行: '+' 附近有语法错误。
消息 170,级别 15,状态 1,过程 usp_deletezichan,第 13 行
第 13 行: '+' 附近有语法错误。
创建的不对吗?.NET事务