Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8915473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:58:58+00:00 2026-06-15T04:58:58+00:00

I have a SQL Server stored procedure that normally runs fine. However, for one

  • 0

I have a SQL Server stored procedure that normally runs fine. However, for one record as I walk through the stored procedure it is “skipping” a line without running it.

if not exists ( select * ... ) begin
    exec @Result = InsertRecord_A @AccountNo, @ID, @EventID;
    if @Result <> 0 return @Result;

    -- Do something else
    insert into ...
    select ...
end

That line, exec @Result... is being skipped in this case. Normally it launches the procedure InsertRecord_A but I can’t get it to run on this record.

Any ideas?

Update: There is the following error message:

Msg 201, Level 16, State 4, Procedure InsertRecord_A, Line 0
Procedure or function 'InsertRecord_A' expects parameter '@EventID', which was not supplied.

What is odd about the error message, is when walking through it, @EventID shows it has a value of 460 which is correct.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:58:59+00:00Added an answer on June 15, 2026 at 4:58 am

    Try explicitly setting the parameters to the correct values, rather than passing them by ordinal position and hoping they’re in the correct order:

    exec @Result = InsertRecord_A @AccountNo = @AccountNo, @ID = @ID, @EventID = @EventID;
    

    This is of course assumes that your InsertRecord_A procedure does take 3 procedures with the same names as your variables.

    If you’re not sure about this, you can run exec sp_help InsertRecord_A or look in the sys.parameters table to check what they’re called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that runs a stored procedure in SQL Server, checking the
The problem is I have a stored procedure that runs consistently in Sql Server
We have the following simple Stored Procedure that runs as an overnight SQL server
I have a stored procedure that executes perfectly in SQL Server. However I am
I have a SQL Server 2008 R2 stored procedure that runs a few INSERTs
I have a SQL Server stored procedure that is not returning any data when
I have written a SQL Server stored procedure that includes a DateTime parameter. This
On our SQL Server (Version 10.0.1600), I have a stored procedure that I wrote.
Let's say I have a stored procedure in Microsoft SQL Server 2005 that returns
I have a stored procedure that runs custom backups for around 60 SQL servers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.