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

  • Home
  • SEARCH
  • 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 6351075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:55:57+00:00 2026-05-24T21:55:57+00:00

I am using SSIS (SQL Server 2008) to lookup values from a table. I

  • 0

I am using SSIS (SQL Server 2008) to lookup values from a table. I wanted to know if the following are possible:

Question 1

Lookup Table 1

Manager_Name    EMP_UNIT    Job_Profile_ID
AAA             SALES       27
BBB             HR          28
AAA             SALES       29

I have to pass the ‘Manager_Name ‘and ‘EMP_UNIT ‘value in the Lookup table and fetch
Job Profile ID in Comma separated format.
Like I will pass the Values ‘AAA’ and ‘SALES’ and I want the return value as 27,29
How will I do this?

Question 2

Lookup Table 2

Job_Profile_ID  Job_Name
27              Jr. Salesman
28              Sales Manager
29              Sr. Salesman

I have to pass the Job Profile ID values in Comma separated format (27, 29) and
I want the return value in Comma separated format (Jr. Salesman, Sr. Salesman).
Is this possible in SSIS?

Environment details:
MS SQL Server integration services (bids) 2008 on windows 2008 server

any help is appreciated,

Thanks

  • 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-24T21:55:57+00:00Added an answer on May 24, 2026 at 9:55 pm

    If I understand your question correctly, you need the list of job names for a given manager and employee unit combination. If that is the case, you need a stored procedure that can give the list of job names in a comma separated value.

    In my opinion, two lookup transformation tasks seems to be a overkill.

    Based on the data provided in the question, the section Create and populate tables provide the sample data.

    Create the following stored procedure dbo.GetManagerJobProfiles that will take Manager_Name and Emp_Unit as input parameters and will return the list of matching job names for the given parameters as a comma separated list. This stored procedure uses FOR XML clause to generate the comma separated values. Since the comma is appended at the beginning, we have to truncate the first comma from the list. Hence, the substring function is used to do that job to give a cleaner output.

    CREATE PROCEDURE dbo.GetManagerJobProfiles
    (
            @Manager_Name   NVARCHAR(80)
        ,   @Emp_Unit       NVARCHAR(80)
    )
    AS
    BEGIN   
        SET NOCOUNT ON;
    
        SELECT SUBSTRING(
                (
                    SELECT          ', ' + J.Job_Name
                    FROM            dbo.Managers        M
                    LEFT OUTER JOIN dbo.Jobs            J
                    ON              M.Job_Profile_Id    = J.Job_Profile_Id
                    WHERE           M.Manager_Name      = @Manager_Name
                    AND             M.Emp_Unit          = @Emp_Unit
                    FOR XML PATH ('')
                )
            , 3, 1000) AS Job_Name
    END
    GO
    

    Screenshot #1 shows the sample data in the tables dbo.Managers and dbo.Jobs.

    Table data

    Screenshot #2 shows the stored procedure output for two different sets of parameters.

    Stored procedure output

    If I have to use this in an SSIS package, I would get the list of distinct Manager_Name and Emp_Unit combinations using an Execute SQL Task and will populate the resultset into an SSIS Package variable of data type Object.

    I will then loop through the object variable using Foreach loop container with Foreach ADO enumerator. Within the Foreach loop container, I will place a Data Flow Task. Within the data flow task, I will place an OLE DB Source which will use the stored procedure as the source. For each Manager_Name and Emp_Unit combination being looped through, the values will be passed as parameters to the OLE DB Source to fetch the Job name values.

    Hope that helps.

    Create and populate tables: This structure is based on the data provided in the question.

    CREATE TABLE [dbo].[Jobs](
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [Job_Profile_Id] [int] NOT NULL,
        [Job_Name] [nvarchar](40) NOT NULL,
    CONSTRAINT [PK_Jobs] PRIMARY KEY CLUSTERED ([Id] ASC)) ON [PRIMARY]
    GO
    
    CREATE TABLE [dbo].[Managers](
        [Id] [int] IDENTITY(1,1) NOT NULL,
        [Manager_Name] [nvarchar](80) NOT NULL,
        [Emp_Unit] [nvarchar](80) NOT NULL,
        [Job_Profile_Id] [int] NOT NULL,
    CONSTRAINT [PK_Managers] PRIMARY KEY CLUSTERED ([Id] ASC)) ON [PRIMARY]
    GO
    
    INSERT INTO dbo.Managers (Manager_Name, Emp_Unit, Job_Profile_Id) VALUES
        ('AAA', 'SALES', 27),
        ('BBB', 'HR', 28),
        ('AAA', 'SALES', 29);
    
    INSERT INTO dbo.Jobs(Job_Profile_Id, Job_Name) VALUES
        (27, 'Jr. Salesman'),
        (28, 'Sales Manager'),
        (29, 'Sr. Salesman');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SSIS to import data from Excel sheets into SQL Server 2005, the
I am copying data from MS Access to SQL Server using SSIS. Only one
I'm creating a data mart in SQL Server 2008 using SSIS for load, and
I am using SSIS with SQL Server 2008 R2. I am importing large-ish text
I am using SQL Server SSIS 2008 R2. I want to dynamically change a
I'm pulling in data from a flat file into a SQL Server 2008 table.
I have an Execute SQL task (SQL 2008) where I'm using two SSIS variables
I have an SSIS package that queries data from a view using an SQL
In VB pseudocode, I'm trying to accomplish the following using SSIS (either 2008 or
SQL Server 2008 provides the ability to script data as Insert statements using the

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.