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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:54:02+00:00 2026-05-14T02:54:02+00:00

In a Data Flow, I have an Derived Column task. In the expression for

  • 0

In a Data Flow, I have an Derived Column task. In the expression for one of the columns, I have the following expression:

[siteid] == "100" ? "1101" : [siteid] == "110" ? "1001" : [siteid] == "120" ? "2101" : [siteid] == "140" ? "1102" : [siteid] == "210" ? "2001" : [siteid] == "310" ? "3001" : [siteid]

This works just fine. However, I intend to reuse this in at least a dozen other places so I want to store this to a variable and use the variable in the Derived Column instead of the hard-coded expression. When I attempt to create a variable, using the expression above, I get a syntax error saying ‘siteid’ is not defined. I guess this makes sense because it isn’t. But how can I get this the expression to work by using a variable? It seems like I need some sort of way to tell it that ‘siteid’ will be the column containing the data I want to apply the expression to.

  • 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-14T02:54:03+00:00Added an answer on May 14, 2026 at 2:54 am

    You can’t use column names in variable expressions. I’m afraid there is no way to easily “clone” this logic in SSIS.

    I would suggest, however, that you don’t attempt to clone hard-coded logic like this. Construct a reference table and use a Lookup component to fetch the value. That way, if your “case” statement ever changes, you only need to do one modification – you don’t need to hunt down everywhere this logic gets used. And configuration of the Lookup is pretty drag and drop easy.

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

Sidebar

Related Questions

I have a slow custom data source in a SSIS Dataa Flow Task.I have
I have about 20 data flow tasks arranged into a group in my control
table data of 2 columns category and subcategory i want to get a collection
I have a FoxPro data source, and the destination is SQL Server 2008. On
Data: a dependency list, already verified to be acyclic. So here, 'a' depends on
Data table structure is: id1,id2,id3,id4,... (some other fields). I want to create summary query
For data types such as std::set and std::map where lookup occurs in logarithmic time,
Change Data Capture is a new feature in SQL Server 2008. From MSDN: Change
In data processing, I frequently need to create a lookup data structure to map
Trends data from Twitter Search API in JSON. Grabbing the file using: $jsonurl =

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.