title: Incorrect Syntax in a Stored Procedure
body: <p>I have written a stored procedure and am getting incorrect syntax near line 64 commit</p>
  
  <pre><code>CREATE PROCEDURE dbo.Transactions_Create
  (@AccountID INT, @EmplNo smallint,@Amount Money,@Description     VARCHAR(100),@EnteredBy VARCHAR(41),@Type char(1),
    @TransId INT OUTPUT)
  
  AS
      SET XACT_ABORT ON;
      BEGIN Transaction
          Declare @ActType dbo.AccountType
          select @ActType =Type from dbo.Accounts
          where AccountId=@AccountID;
  
  Declare @Withdraw smallint
  select @Withdraw
  =WithdrawalCount from dbo.Accounts
  where AccountId=@AccountId
  
  Declare @ServiceFee Money
  Declare @withdrawchange smallInt
  Declare @balancechange Money
  
  if @Type='D'
      BEGIN 
          SET @ServiceFee=0.0;
          SET @withdrawchange=0;
          SET @balancechange=@Amount;
  
      end;
  else 
      BEGIN       
          SET @withdrawchange=1;
          if @ActType='cheaquing' 
              begin
                  SET @ServiceFee=0.50;
              end
              else
                  begin
                      if @Withdraw&lt;2
                          begin 
                              SET @ServiceFee=0.0;
                      end
                      else
                          begin
                              SET @ServiceFee=1.00;
                          end
      SET @balancechange=(@Amount-@ServiceFee)*-1;
      end
  update dbo.Accounts 
  SET Balance= balance+@balancechange, WithdrawalCount=WithdrawalCount+@withdrawchange
  where AccountId=@AccountId;
  
  INSERT Into dbo.Transactions(AccountID, EmplNo ,Amount, Description    ,EnteredBy ,Type)
  
  values (@AccountID, @EmplNo ,@Amount, @Description ,@EnteredBy ,@Type );
  
  SET @TransID = SCOPE_IDENTITY();
  
  commit Transaction;
  </code></pre>
  
  <p>I am not sure what is wrong with my syntax. Everything looks correct to me, From what I understood everything should go inside the BEGIN TRANSACTION COMMIT TRANSACTION block so I do not understand why this is failing</p>