Need help debugging this SQL Procedure for MSSQL :   Hi I've been trying to create the Procedure as below but after queriing it kept giving me these errors 
sg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 164
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 165
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 166
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 167
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 168
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 169
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 170
Must declare the scalar variable "@V_ERR_REC".
Msg 137, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 171
Must declare the scalar variable "@V_ERR_REC".
Msg 102, Level 15, State 1, Procedure PKG_BNLX5_INSERT_DMBATCHERRLOG, Line 172
Incorrect syntax near '@V_ERR_REC'.


  CREATE     PROCEDURE "PKG_BNLX5_INSERT_DMBATCHERRLOG"(@IN_PROCNAME      VARCHAR(4000),
                                     @IN_TARNAME       VARCHAR(4000),
                                     @IN_CURSOR        VARCHAR(4000),
                                     @IN_UNIQUE_NUMBER FLOAT,
                                     @IN_SQLCODE       VARCHAR(4000),
                                     @IN_SQLERRM       VARCHAR(4000),
                                     @IN_REMARK        VARCHAR(4000)) AS
     BEGIN
    
    
       
      SET NOCOUNT ON;
        SET @V_ERR_REC.PROCNAME      = @IN_PROCNAME;
        SET @V_ERR_REC.TARNAME       = @IN_TARNAME;
        SET @V_ERR_REC.CURSOR        = @IN_CURSOR;
        SET @V_ERR_REC.UNIQUE_NUMBER = @IN_UNIQUE_NUMBER;
        SET @V_ERR_REC.DATIME        = GETDATE();
        SET @V_ERR_REC.ERRCODE       = @IN_SQLCODE;
        SET @V_ERR_REC.ERRDESC       = @IN_SQLERRM;
        SET @V_ERR_REC.REMARK        = @IN_REMARK;
        INSERT INTO VM1DTA.DMBATCHERRLOG VALUES @V_ERR_REC;
        COMMIT;
      END;