Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Server + Procedure or function has too many arguments specified

SQL Server + Procedure or function has too many arguments specified

Scheduled Pinned Locked Moved Database
databasehelpsql-serversysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hemant Thaker
    wrote on last edited by
    #1

    Hi Friends, I have windows service which will execute a STORED PROCEDURE during a time period, fetches email IDs from DB and will send emails to them. I am passing only one argument @ValidTillDays INT. I made this service run on each day. If its running for 3 days, then for the first day it executes perfectly. For the second day and remaining all days it gives following error. Procedure or function "BlaBlaBla" has too many arguments specified. I have only one input parameter and I am passing only one too. And if this was the case it could have given the error for the first time also. Please help me if you find any clue . Thanks :)

    By: Hemant Thaker

    S M H 3 Replies Last reply
    0
    • H Hemant Thaker

      Hi Friends, I have windows service which will execute a STORED PROCEDURE during a time period, fetches email IDs from DB and will send emails to them. I am passing only one argument @ValidTillDays INT. I made this service run on each day. If its running for 3 days, then for the first day it executes perfectly. For the second day and remaining all days it gives following error. Procedure or function "BlaBlaBla" has too many arguments specified. I have only one input parameter and I am passing only one too. And if this was the case it could have given the error for the first time also. Please help me if you find any clue . Thanks :)

      By: Hemant Thaker

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Hemant Thaker wrote:

      If its running for 3 days, then for the first day it executes perfectly.
      For the second day and remaining all days it gives following error.

      Strange. Based on what you share, sounds like some logical error where you are considering the DayNo. Are you? Somehow, somewhere the current day is getting into picture while running the procedure and the error. Did you DEBUG and see? Check if so.

      Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

      1 Reply Last reply
      0
      • H Hemant Thaker

        Hi Friends, I have windows service which will execute a STORED PROCEDURE during a time period, fetches email IDs from DB and will send emails to them. I am passing only one argument @ValidTillDays INT. I made this service run on each day. If its running for 3 days, then for the first day it executes perfectly. For the second day and remaining all days it gives following error. Procedure or function "BlaBlaBla" has too many arguments specified. I have only one input parameter and I am passing only one too. And if this was the case it could have given the error for the first time also. Please help me if you find any clue . Thanks :)

        By: Hemant Thaker

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        I suspect you are concatenating the parameter value and passing in a string! You might want to post the code used to build the procedure call.

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        • H Hemant Thaker

          Hi Friends, I have windows service which will execute a STORED PROCEDURE during a time period, fetches email IDs from DB and will send emails to them. I am passing only one argument @ValidTillDays INT. I made this service run on each day. If its running for 3 days, then for the first day it executes perfectly. For the second day and remaining all days it gives following error. Procedure or function "BlaBlaBla" has too many arguments specified. I have only one input parameter and I am passing only one too. And if this was the case it could have given the error for the first time also. Please help me if you find any clue . Thanks :)

          By: Hemant Thaker

          H Offline
          H Offline
          Hemant Thaker
          wrote on last edited by
          #4

          Thanks for your responses. Error is resolved, that was more logical. I was creating Command object at class level, and adding parameters to it in remainderMailtimer_Elapsed(). This event will execute on timer interval. So when it executes first time it find one parameter and runs successfully. after 3 minutes interval it executes event for the second time and adds same parameter to it. so now command object will have two parameters and corresponding SP has one. So it was throwing error. I changed the code and created command object at event level. Thanks.

          By: Hemant Thaker

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups