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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:25:01+00:00 2026-05-22T21:25:01+00:00

I have a stored proc that has several parameters. Most of them allow for

  • 0

I have a stored proc that has several parameters. Most of them allow for multiple selections in a drop-down menu. They are: vOwner, vFunction, vSite, vStatus (all multiple selections allowed and the “Select All” is also enabled), and then vStartDate and vEndDate.

For some reason, when I choose “Select All” for every parameter, SSRS cuts off some of the records. It seems to report everything except records for the very last “owner.” I’m looking for a clue as to why this might be happening. It happens when I select just one date’s worth of data. It’s as though that last owner isn’t even being picked up as part of the data set.

Where SSRS is concerned, the settings are fairly simple. I have a data set that references the stored procedure (below), and one for each of the lookup tables i have (function, status, etc.) Any help is appreciated. Let me know if other information is needed. Thanks!

Stored Procedure:

@vOwner varchar(1000) = NULL, 
@vFunction varchar(1000) = NULL, 
@vStatus varchar(1000) = NULL,
@vLocation varchar(1000) = NULL,
@vBeginDate datetime = NULL,
@vEndDate datetime = NULL

AS

BEGIN


    --Allow for multiple owners, functions, etc. to be selected in SSRS.
    Select @vOwner = ', ' + @vOwner + ', '
    create table #Owner
    (
    Owner varchar(1000)
    )

    Insert Into #Owner 
    Select  ManagerLastName + ', ' + ManagerFirstName As Owner
    From Managers 
    Where  @vOwner Like  '%, ' + ManagerLastName + ', ' + ManagerFirstName + ', %'
    Group By ManagerLastName, ManagerFirstName

    --Function
    Select @vFunction = ', ' + @vFunction + ', '
    create table #Function
    (
    Functions varchar(1000)
    )

    Insert Into #Function
    Select  Functions
    From Functions 
    Where  @vFunction Like  '%, ' + Functions + ', %'
    Group By Functions

    --Status
    Select @vStatus = ', ' + @vStatus + ', '
    create table #Status
    (
    IssueStatus varchar(1000)
    )

    Insert Into #Status
    Select  IssueStatus
    From IssueStatus 
    Where  @vStatus Like  '%, ' + IssueStatus + ', %'
    Group By IssueStatus

    --Sites
    Select @vLocation = ', ' + @vLocation + ', '
    create table #Sites
    (
    siteName varchar(1000)
    )

    Insert Into #Sites 
    Select  siteName
    From Sites  
    Where  @vLocation Like  '%, ' + siteName + ', %'
    Group By siteName


    Select 
    recID,
    siteName
    functions

    From issueInput

    Where 
    @vFunction Like  '%, ' + functions + ', %'
    And @vOwner Like  '%, ' + ManagerLastName + ', ' + ManagerFirstName + ', %' 
    And @vStatus Like  '%, ' +  IssueStatus + ', %'
    And @vLocation Like  '%, ' +  SiteName + ', %'
    And (@vBeginDate Is Null Or @vBeginDate = 0 Or @vBeginDate <= Cast(Convert(varchar,(OpenDate),101) As datetime))
    And (@vEndDate Is Null Or @vEndDate = 0 Or @vEndDate >= Cast(Convert(varchar,(OpenDate),101) As datetime))

    Order by OpenDate

END
  • 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-05-22T21:25:02+00:00Added an answer on May 22, 2026 at 9:25 pm

    Looks like it wasn’t a flaw in SSRS at all. After testing it out more in SSMS, I discovered that it was only the owner value that was being cut off at the end. I increased the @vOwner parameter from varchar(1000) to varchar(2000) and it is working fine now. I was simply passing too many characters into that parameter and it was getting truncated. Problem solved. Thanks to billinkc for that light bulb!

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

Sidebar

Related Questions

I have a stored procedure that has a bunch of input and output parameters
Using SQL Server 2005: I have one stored proc that calls several others within
I have a stored proc on sql server 2008 that excepts a int parameter.
I have a stored proc with the basic layout below that returns a sys_refcursor
I have a WCF service method that calls a SQL stored proc. I'm developing
I have a stored proc which has the input param as integer_list_tbltype. I can
I have a stored proc that inserts XML into an underlying table. Unfortunately the
I have a stored proc that takes an input of xml value like this:
So I have a Sybase stored proc that takes 1 parameter that's a comma
You'd like to call a stored proc on MS SQL that has a parameter

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.