Forum Replies Created

Viewing 2 posts - 1 through 3 (of 3 total)

  • RE: Loop Deleted trigger table

    Hi, using your help I come up with the following solution for the trigger:

    IF (@action = 'INSERT')

    BEGIN

    -- update existing balances

    UPDATE dbo.AccountBalance

    SET Balance = Balance + i.Debit - i.Credit

    FROM AccountBalance b,...

  • RE: Loop Deleted trigger table

    Thank you for your help, here is my script:

    Stored Procedure:

    ALTER PROC [dbo].[usp_UpdateAccountBalance] @AccountId INT, @Amount MONEY

    AS

    DECLARE @Count INT;

    SELECT @Count = COUNT(*) FROM dbo.AccountBalance

    WHERE AccountId = @AccountId;

    IF (@Count = 0)

    BEGIN

    INSERT INTO...

Viewing 2 posts - 1 through 3 (of 3 total)