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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:35:24+00:00 2026-06-17T11:35:24+00:00

I have an SSIS project in which I would like to set one of

  • 0

I have an SSIS project in which I would like to set one of my package variables to the maximum value of some column in one of my database tables. Suppose the package variable is called var.

my SQL would look like:

SET var = (SELECT max(some_column) from SomeTable)

How does this fit into an SSIS Control Flow /Data Flow? What type of task would this SQL go into? Can I even access a package variable via SQL?

  • 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-17T11:35:25+00:00Added an answer on June 17, 2026 at 11:35 am

    You can use an Execute Sql Task to accomplish this. The syntax will vary depending on the type of database connection you are using (OleDb or .Net).

    If you are using an OleDb connection manager, your sql statement will look something like this:

    SELECT ? = MAX(some_column) FROM some_table
    

    Then select the Parameter Mapping tab to map your parameter/variable. Select your package variable from the dropdown for the “Variable Name” field. Set the Direction to Output and set the Parameter Name to 0. (variables on an OleDb connection are mapped in sequential order starting from 0)

    If you are using a .Net connection manager, you can use the more familiar @variableName for the parameter place holder in your sql statement, as well as the Parameter Name in the Execute SQL task.

    Edit: In response to your comment. See a few screenshots pulled directly from one of my projects. Please compare what you are doing to make sure we are on the same page.

    In this shot, note the connection type of the Execute Sql Task and note the last statement of the Sql Statement where I am selecting a parameter to be equal to a sql function.

    SSIS Example 1

    In this next shot, see how I am configuring the second parameter, making sure that the parameter direction is set to output. The parameter is named 1 as it is the second parameter/parameter holder in the sql statement.
    SSIS Example 2

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

Sidebar

Related Questions

I have an SSIS package with a for loop. I would like to keep
I have an ssis package...which read data from fixed-column-width text file into DB table.
I have a SSIS project that queries a database and get item level data.
I have an SSIS project where one of the steps involves populating a SQL
I have a SSIS package built in Business Intellegience Development Studio which have both
I have simple SSIS package which reads data from flat file and insert into
I have created an SSISpackage in my asp.net project.To call the ssis package, i
I have crated SSIS project which does the following thing Control Flow :- Data
I have a project that runs some code on SSIS in SqlServer 2005 and
I have SSIS package which pulls the data from Excel(.xls) file and load 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.