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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:42:38+00:00 2026-05-23T12:42:38+00:00

When you try to create this proc on MS SQL Server 2008 and try

  • 0

When you try to create this proc on MS SQL Server 2008 and try to bind a report (Crystal or SQL Server reporting) you can’t get any parameter from the report. I don’t get any errors. I just see the proc name and no column under it to get any data from it. Please help

create proc getdata 
@where as nvarchar (max)
as
declare @sql as varchar(max)
set @sql='select cp.address,
(case when cp.male =1 then ''Male'' 
      when cp.female =1 then ''Female'' 
      else null end ) AS "Gender" 
from consumer_premium cp where '+ @where
exec(@sql);

@where example execution

getdata 'male=1'

thats the table

CREATE TABLE [dbo].[Consumer_Premium](
    [Address] [nvarchar](255) NULL,
    [Male] [bit] NULL,
    [Female] [bit] NULL)

please help.

  • 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-23T12:42:39+00:00Added an answer on May 23, 2026 at 12:42 pm

    Here is one possible option that you can try if you are using SSRS 2008. Following example was created using SSRS 2008 based on the data provided in the question.

    1. Create a table named dbo.Consumer_Premium and stored procedure named dbo.GetData using the scripts provided under SQL Scripts section. Populate the table with data as shown in screenshot #1.

    2. Create an SSRS report named BindWhere.rdl as shown in screenshot #2.

    3. Create a report parameter named Gender with settings as shown in screenshots #3 – #5.

    4. Configure the report data source as shown in screenshots #6 – #8.

    5. Screenshot #9 shows default report execution with parameter Gender set to value Male.

    6. Screenshot #10 shows default report execution when the parameter Gender value is changed to Female. You need to click on the View Report button to refresh the data.

    Hope that helps.

    SQL Scripts:

    CREATE TABLE [dbo].[Consumer_Premium](
        [Address] [nvarchar](255) NULL,
        [Male] [bit] NULL,
        [Female] [bit] NULL
    ) ON [PRIMARY]
    GO
    
    CREATE PROCEDURE getdata 
    (
        @where AS NVARCHAR(MAX)
    )   
    AS
        DECLARE @sql AS VARCHAR(MAX)
        SET @sql='select cp.address,
        (case when cp.male =1 then ''Male'' 
              when cp.female =1 then ''Female'' 
              else null end ) AS "Gender" 
        from consumer_premium cp where '+ @where
        EXEC(@sql);
    GO
    

    Screenshot #1:

    1

    Screenshot #2:

    2

    Screenshot #3:

    3

    Screenshot #4:

    4

    Screenshot #5:

    5

    Screenshot #6:

    6

    Screenshot #7:

    7

    Screenshot #8:

    8

    Screenshot #9:

    9

    Screenshot #10:

    10

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

Sidebar

Related Questions

When I try to create a new Maintenance Plan in SQL Server, I get
When I try to create a SQL Server Login by saying CREATE LOGIN [ourdomain\SQLAccessGroup]
In Delphi, is normal do this: ob = TObject.create; try //code finally ob.free; end;
When I try to create a Excel 2007 Workbook project, in Visual Studio 2008,
I have a stored proc in SQL Server 2005, which looks like the following
At the moment I write stored procedures this way: create proc doStuff @amount int
Because of some In Proc problems I try to switch to SQL State session.
Running SQL 2005 X64. First, create the following stored proc on a database: CREATE
When I try to create a new RegionInfo with certain ISO 3166 country codes
When I try to create a Excel or Word workbook project in VS, I

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.