too many arguments in stored procedures?

  • when i try to insert my data through this stored procedure. it give me an error msg saying "Too many arguments". But i've to insert all these arguments. how can i resolve it??

    CREATE         PROCEDURE dbo.SP_InsertNewCustomer

     @customerId                 nvarchar(50),

     @branchId             nvarchar(50),

     @mobileNo             bigInt,

     @customerName             nvarchar(50),

     @customeruserName           nvarchar(50),

     @residenceAddress     nvarchar(50),

     @customerBusinessType       nvarchar(50),

            @residenceTelePhone     bigInt, 

     @billingAddress           nvarchar(50),

            @accountContect             nvarchar(50),

     @companyName      nvarchar(50),

     @telePh       bigInt,

     @officeAddress      nvarchar(50),

     @officeTelePhone     bigInt,

     @recordId      bigInt,

     @customerNIC      bigInt,

     @customerNTN             bigInt,

     @passportNo      nvarchar(50),

            @fax       bigint,

     @previousMobileNo     bigint,

     

     @itemCode     nvarchar(50)

                      

    as

    Begin

    INSERT INTO Customer(customerId, branchId, mobileNo, customerName, customeruserName, residenceAddress, customerBusinessType, residenceTelePhone, billingAddress, accountContect, companyName, telePh, officeAddress, officeTelePhone, recordId, customerNIC, customerNTN, passportNo, fax, previousMobileNo)

    VALUES(@customerId, @branchId, @mobileNo, @customerName, @customeruserName, @residenceAddress, @customerBusinessType, @residenceTelePhone, @billingAddress, @accountContect, @companyName, @telePh, @officeAddress, @officeTelePhone, @recordId, @customerNIC, @customerNTN, @passportNo, @fax, @previousMobileNo)

    INSERT INTO Charges(mobileNo)

    Values(@mobileNo)

    INSERT INTO SaleHead( branchId, customerId)

    Values(@branchId, @customerId)

    INSERT INTO SaleDetail(branchId, itemCode, mobileNo)

    Values(@branchId, @itemCode, @mobileNo)

    End

    GO

  • That sounds more like an issue with whatever is calling the stored procedure, not the procedure itself.

  • Yes, please post the calling sequence. There is probably a discrepancy between the parameters in the call and in the SP.

  • make sure your application is clearing out the parameters from the previous stored procedure call before adding the parameters for this call.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply