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 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 data flow with a derived column. I want to convert the
I have a very basic SSIS package with one data flow task (from an
I have a data flow task that extracts data from one database and inserts
I have the following Data Flow task in my SSIS package: alt text http://img228.imageshack.us/img228/358/ssis1.png
I have a SSIS Data Flow Task with an OleDb Source, Conditional Split (w/
I have a slow custom data source in a SSIS Dataa Flow Task.I have
I have a Data Flow Task and am connecting to a database via an
I have a data flow component, comprise of the following : 1.) Read Excel
I have a very simple Data flow task reading data from a FF and
I have a Data Flow Task that does some script component tasks, sorts, then

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.