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 9198219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:14:10+00:00 2026-06-17T22:14:10+00:00

I’m getting a strange error in SSRS, in a report (which gets put into

  • 0

I’m getting a strange error in SSRS, in a report (which gets put into a sproc) with many drop-down parameters:

Query execution failed for dataset 'DataSet1'.

Must pass parameter number 3 and subsequent parameters as '@name = value'. After the form '@name = value' has been used, all subsequent parameters must be passed in the form '@name = value'

I’m lost on what’s going on here – what is meant by @name = value .

I searched online, someone mentioned that you should alter the stored-procedure?

Here is how the top half of my stored-proc looks:

USE [FederatedSample]
GO


SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



ALTER PROCEDURE [dbo].[prc_RPT_Select_BI_Completes_Data_View_2]


    @FromDate DATETIME,
    @ToDate DATETIME,

    @AccountIDs VARCHAR(max) = null,
    @ClientIDs VARCHAR(max) = null,
    @SupplierIDs VARCHAR(max) = null,

    @CompleteType INT = NULL,
    /*
     * 0 - Routed
     * 1 - Targeted
     * 2 - Offerwall
     */

    @SourceType BIT = NULL,
    /*
     * Works if @AccountID is not null
     * (should only be used if @AccountID has a single value)
     *
     * 0 - Owned by @AccountID
     * 1 - External (not owned by @AccountID)
     */

    @SurveyStatus INT = NULL,
    /*
     * NULL - All Surveys
     * 0 - Completes Approved Surveys
     * 1 - Invoiced Surveys
     */

    @IsSupplierUser BIT = 0
    /*
     * used to decide whether to display FEDSurveyName or SupplierSurveyName
     */
AS
BEGIN
    SET NOCOUNT ON

    DECLARE @SQL NVARCHAR(MAX) = N'',
            @Params NVARCHAR(MAX)

    IF @AccountIDs is not null
    BEGIN
        SET @SQL += N'DECLARE @AccountIDs VARCHAR(MAX) = @pAccountIDs; '
    END

    IF @ClientIDs is not null
    BEGIN
        SET @SQL += N'DECLARE @ClientIDs VARCHAR(MAX) = @pClientIDs; '
    END

    IF @SupplierIDs is not null
    BEGIN
        SET @SQL += N'DECLARE @SupplierIDs VARCHAR(MAX) = @pSupplierIDs; '
    END

    SET @SQL +=  N'
        SELECT   bi.SupplierID as ''Supplier ID''
                ,bi.SupplierName as ''Supplier Name''

                ,bi.PID as ''PID''
                ,bi.RespondentID as ''Respondent ID''

                ,lk_slt.Name as ''Entry Link Type''

                ,ts.SurveyNumber as ''Initial Survey ID'''

And later in the stored proc. it does stuff like this to split strings:

IF @AccountIDs is not null 
BEGIN
    SET @SQL += CHAR(13) + CHAR(9)
    SET @SQL += N' and bi.AccountID in (SELECT CAST(val as INT) FROM dbo.Split(@AccountIDs, '','

enter image description here

  • 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-17T22:14:11+00:00Added an answer on June 17, 2026 at 10:14 pm

    When invoking a stored procedure, you either can pass the parameters by position (not a good idea) or by Name (a better approach IMHO).

    EXEC dbo.MyStoredProcedure '12/31/2012', 1;  -- Not a great way to pass parameters 
    
    EXEC dbo.MyStoredProcedure @AsOfDate = '12/31/2012', @AccountID = 1; -- A better way
    

    From the error message you are receiving, I suspect that SSRS is using the second approach and is running into an issue with the third parameter being provided to the stored procedure.

    Without more information to go off of it is difficult to provide you with an exact explanation for the error (the stored procedure would perhaps help), an educated guess is that the way the parameters are being provided for Account IDs, Client IDs and Supplier IDs isn’t quite correct. Specifically, I think the problem might be that you are providing multiple identifiers delimited by a comma.

    You might try passing a single Account ID, Client ID and Supplier ID to see if you still receive the error. I would also try to look at the stored procedure (or talk to the DBA \ Developer who wrote it) to ascertain the intended usage of the stored procedure.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I've tracked down a weird MySQL problem to the two different ways I was

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.