ALTER PROCEDURE [dbo].[Proc_DomainSales_Pay]
    @id int,--域名拍卖表ID
    @uid int,--用户ID
    @money numeric(18, 2),--冻结金额
    @ret int output --成功返回1,失败返回零
AS
BEGIN
begin transaction
if(@money>0)
begin
   --解冻拍卖领先金额-Start
    declare @congeal_moneysum numeric(9,2)
    set @congeal_moneysum = 0
    select @congeal_moneysum = moneysum FROM eb_congeal where userid=@uid and linkid=@id and types = 2 and state = 1
    if not @congeal_moneysum is null and @congeal_moneysum <> 0
    begin
    -- 更新用户冻结金额
        update eb_user set usemoney=usemoney + @congeal_moneysum, Congealsum = Congealsum - @congeal_moneysum where id = @uid
        if(@@error<>0)
        begin
            set @ret=0;
            rollback transaction;
            return 1;
        end
        update eb_congeal set state= 0 where userid=@uid and linkid=@id and types = 1 and state = 1
        if(@@error<>0)
        begin
            set @ret=0;
            rollback transaction;
            return 1;
        end
    end   --解冻拍卖领先金额--End    declare @strdomain varchar(256);
--修改用户可用金额
    update eb_user set     useMoney=useMoney-@money, Congealsum=Congealsum+@money  where id=@uid
    if(@@error<>0)
    begin
        set @ret=0;
        rollback transaction;
        return 1;
    end
    select @strdomain=strdomain from EB_domain_sals where userid=@uid
    --增加冻结信息
    INSERT INTO EB_Congeal( [linkid], [Moneysum], [userid], [types], [re], [addtime], [state])
    VALUES(@id,@money,@uid,102,'支付拍卖域名'+@strdomain+'冻结',getdate(),1);
    if(@@error<>0)
    begin
        set @ret=0;
        rollback transaction;
        return 1;
    end
    --增加财务记录
    --改变域名操作状态
    update Eb_domain_sals set mkstate=1 where[id]=@id
end    if(@@error =0)
    begin
        set @ret=1
        commit transaction;
        return 1;
    end
   
        set @ret=0
        rollback transaction
   
END程序在执行时,提示
EXECUTE 后的事务计数指出缺少了 COMMIT 或 ROLLBACK TRANSACTION 语句。原计数 = 0,当前计数 = 1
我实在看不出来哪儿的问题