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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:52:06+00:00 2026-06-15T21:52:06+00:00

Given: SQL Server 2008 R2 SSRS 2008 Humble Programmer Consider two tables: CREATE TABLE

  • 0

Given:

  • SQL Server 2008 R2
  • SSRS 2008
  • Humble Programmer

Consider two tables:

CREATE TABLE PERSON
(
    PersonID INT,
    Name VARCHAR(100)
)

CREATE TABLE PERSON_EXTENDED
(
    PersonExtendedID INT,
    PersonID INT,
    DOB DATETIME,
    FavoriteColor VARCHAR(100)
)

Further consider the following query joining the tables suggesting their relationship.

SELECT
    *
FROM
    PERSON AS P
    JOIN PERSON_EXTENDED AS PE ON (P.PersonID = PE.PersonID)

To give you the overall concept I want to create a stored procedure that will populate the field selection parameter of an SSRS report. Then using the selected parameters pass that as as argument to another stored procedure which creates the report with the selected fields.

My thought was something like the following initially, however that yields 2 issues. First the duplicate ordinality for 1 and 2 across both the tables. Second the duplicate column name “PersonID”.

SELECT
    C.COLUMN_NAME,
    C.ORDINAL_POSITION
FROM
    INFORMATION_SCHEMA.columns AS C
WHERE
    C.TABLE_NAME = 'PERSON'
    OR C.TABLE_NAME = 'PERSON_EXTENDED'

Any thoughts? Extra credit would be to do this in a scalable way and include some sort of “Display Name” field so the end user didn’t have to deal with PersonID but could deal with “Personal Identification”.

  • 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-15T21:52:07+00:00Added an answer on June 15, 2026 at 9:52 pm

    Great Article!

    This article is a big step in the right direction and may actually be the complete solution. It is certainly relevant enough to be an answer for anyone else in a similar situation.

    One of the comments is particularly intriguing:

    Hi Hari, I used an alternative form of the hide column expression when
    dealing with the multivalue parameter.

    =IIF(Filter(Parameters!MultiOption.Value,”6″,true).Length>0,False,True)

    Which means to show this column if it’s selected in the parameter
    list. In this example, 6 is the id of the label.

    I had such a small dataset, so going to the trouble of tailoring the
    query was not important.

    I am concerned this is going to be hugely resource intensive though.

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

Sidebar

Related Questions

In SQL Server 2008, I have the following tables: CREATE TABLE samples (SampleID int,
In an SQL Server 2008 database, I have tables such as: CREATE TABLE t_DeviceType
Given two scenarios on SQL Server 2008/2005 - 1 Table has 5 rows 2
This is in SQL Server 2008. I plan to create two tables to represent
In a SQL Server 2008 R2 database, given this schema: AgentsAccounts _______________ AgentID int
Why does SQL server express 2008 give me this error? CREATE TABLE model (
In a given SQL Server 2008 table I have a disabled foreign key constraint
I am developing some reports in SSRS (SQL Server 2008 R2). I have given
T-SQL, SQL Server 2008 and up Given a sample table of StatusSetDateTime | UserID
Given the following simple table structure (SQL Server 2008), I want to be able

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.