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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:23:27+00:00 2026-05-30T18:23:27+00:00

I am currently using SSIS to read the data from a table, modify a

  • 0

I am currently using SSIS to read the data from a table, modify a column and inset it into a new table.

The modification I want to perform will occur if a previously read row has an identical value in a particular column.

My original idea was to use a c# script with a dictionary containing previously read values and a count of how many times it has been seen.

My problem is that I cannot save a dictionary as an SSIS variable. Is it possible to save a C# variable inside an SSIS script component? or is there another method I could use to accomplish this.

As an example, the data below

/--------------------------------\
| Unique Column | To be modified |
|--------------------------------|
|   X5FG        |      0         |
|   QFJD        |      0         |
|   X5FG        |      0         |
|   X5FG        |      0         |
|   DFHG        |      0         |
|   DDFB        |      0         |
|   DDFB        |      0         |

will be transformed into

/--------------------------------\
| Unique Column | To be modified |
|--------------------------------|
|   X5FG        |      0         |
|   QFJD        |      0         |
|   X5FG        |      1         |
|   X5FG        |      2         |
|   DFHG        |      0         |
|   DDFB        |      0         |
|   DDFB        |      1         |
  • 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-30T18:23:28+00:00Added an answer on May 30, 2026 at 6:23 pm

    Rather than use a cursor, just use a set based statment

    Assuming SQL 2005+ or Oracle, use the ROW_NUMBER function in your source query like so. What’s important to note is the PARTITION BY defines your group/when the numbers restart. The ORDER BY clause directs the order in which the numbers are applied (most recent mod date, oldest first, highest salary, etc)

    SELECT
        D.*
    ,   ROW_NUMBER() OVER (PARTITION BY D.unique_column ORDER BY D.unique_column ) -1 AS keeper
    FROM
    (
        SELECT 'X5FG'
        UNION ALL SELECT 'QFJD'
        UNION ALL SELECT 'X5FG'
        UNION ALL SELECT 'X5FG'
        UNION ALL SELECT 'DFHG'
        UNION ALL SELECT 'DDFB'
        UNION ALL SELECT 'DDFB'
    ) D (unique_column)
    

    Results

    unique_column       keeper
    DDFB                0
    DDFB                1
    DFHG                0
    QFJD                0
    X5FG                0
    X5FG                1
    X5FG                2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to using SSIS 2008 and am currently working on migrating data
I'm currently creating an SSIS job that will pull picture data from a SQL
I've recently been toying with data migration into Microsoft Dynamics CRM using MS SQL
I'm currently generating a large number (100s) of SSIS packages from C# that are
I'm currently working on an SSIS package to load mainframe logs from multiple server/file
Is using SSIS to do reformatting of flat files from one format to another
I am using this in Script Component In SSIS --> Microsoft.Office.Interop.Excel.Application objXL = new
I'm trying to import a csv file into SQL using SSIS and am hitting
I'm currenlty using SSIS for some process flow, scripting, and straight data import. Most
Currently we warehouse our postgres db using SSIS, but there are certain things we

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.