参数1不是过程的参数

参数1不是过程的参数

本文介绍了@参数1不是过程的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ALTER PROCEDURE [dbo].[NST_InsertTblGenLedDet]
        @GHDHeader int,
      @Gldtype text,
      @GldAccount text,
      @GldDate DateTime,
      @GldVoucherType int,
      @GldDebit   float=null,
      @GldCredit float= null,
      @GldDtaLine int= null
AS
DECLARE @ERR INT
BEGIN TRANSACTION
Insert into [TblGenLedDet]
(GHDHeader,Gldtype,GldAccount,GldDate, GldVoucherType, GldDebit,GldCredit,GldDtaLine)
 values (@GHDHeader,@Gldtype,@GldAccount,@GldDate, @GldVoucherType, @GldDebit,@GldCredit,@GldDtaLine)



SET @ERR = @@Error
IF @ERR = 0
BEGIN
      COMMIT TRANSACTION

END
ELSE
BEGIN
      ROLLBACK TRANSACTION
      RETURN @ERR
END

我一次又一次地得到这个错误,虽然我指定的参数名称@GldCredit它显示参数名称参数1

I am getting this error again and again though i have specified the parameter name as @GldCredit it shows Parameter name as Parameter1

推荐答案

在您的code,初始化 gldCredit ,但随后更新 gldDebit 。你的 gldCredit 参数,不具有任何成员的设置,因此,有 ParaameterName defautled到@ Paremeter1

In your code, you initialize gldCredit, but then update gldDebit. Your gldCredit parameter never has any of its members set, and thus, has its ParaameterName defautled to "@Paremeter1".

看起来你复制/粘贴 gldDebit code了设置的参数,却忘了更新$ C $的新块的所有引用C到指向 gldCredit

It looks like you copy/pasted the gldDebit code for setting up your parameter, but forgot to update all the references in the new block of code to point to gldCredit.

这篇关于@参数1不是过程的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 17:09