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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:42:19+00:00 2026-05-23T10:42:19+00:00

OK my first question so here goes. Currently users are using a huge Access

  • 0

OK my first question so here goes.

Currently users are using a huge Access Application. They wanted a web application with some functionality based off of the Access data and with some modifications.

Ok no problem. I used the Access to SQL migration assistant to convert the data over and then wrote some SSIS packages which are executed from the web end to allow the application to be updated as needed. All here is good.

Here is where I am kind of stumped. There are 2 types of imports, quarterly and yearly. The quarterly is fine but the yearly import is causing issues. The yearly import can be for an adopted budget or for a proposed budget (each is held in a separate Access db). I have one SSIS package for each type of yearly import. The table where the information goes is as follows..

CREATE TABLE Budget
(
    BudgetID           uniqueidentifier NOT NULL,
    ProjectNumber      int NOT NULL,
    SubProjectNumber   varchar(6) NOT NULL,
    FiscalYearBegin    int NOT NULL,
    FiscalYearEnd      int NOT NULL,
    Sequence           int NULL,
    QuarterImportDate  datetime NULL,
    ProposedBudget     money NULL,
    AdoptedBudget      money NULL,

    CONSTRAINT PK_Budget PRIMARY KEY CLUSTERED 
    (
        BudgetID ASC
    ),

    CONSTRAINT uc_Budget UNIQUE NONCLUSTERED 
    (
        ProjectNumber ASC,
        SubProjectNumber ASC,
        FiscalYearBegin ASC,
        FiscalYearEnd ASC,
        Sequence ASC
    )
)

Also, there can be multiple versions of the budget for the specific year in terms of Project, SubProject, FiscalYearBegin, and FiscalYearEnd. Thats is why there is a sequence number.

So the problem becomes, since I have 2 different SSIS packages, each of which is an update statement on 1 specific column (either ProposedBudget or AdoptedBudget), I have no effective way of keeping track of the correct sequence.

Please let me know if I can make this any clearer, and any advice would be great!

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-23T10:42:19+00:00Added an answer on May 23, 2026 at 10:42 am

    Something like this will get you the next item with an empty AdoptedBudget, but I think you will need a cursor when there are multiple AdoptedBudgets. I was thinking of doing a nested subquery with an update, but that won’t work when there are multiple AdoptedBudgets. It sounds like in the source application they should be selecting a ProposedBudget whenever they add the AdoptedBudget so that a relationship can be created. This way it is clear which AdoptedBudget goes with which ProposedBudget, and it would be a simple join. I have almost the same scenario, but the difference is that I don’t keep all the versions. I only have to keep the most current “ProposedBudget” and most current “AdoptedBudget”. It’s a little bit more difficult trying to sequence them all.

      --get the smallest SequenceId with an unfilled AdoptedBudget
      Select min(SequenceID), 
        ProjectNumber, 
        FiscalYearBegin, 
        SubProjectNumber --any other fields needed for the join
      From Budgets b
      Where AdoptedBudget is null
      Group By 
        ProjectNumber, 
        FiscalYearBegin, 
        SubProjectNumber --any other fields needed for the join
    
    
    --This won't work I don't believe
    Update Budgets
    Set AdoptedBudget = BudgetAmount
    From Budgets b
    Inner Join SourceAdoptedBudgets ab on 
      b.ProjectNumber = ab.ProjectNumber
      b.FiscalYearBegin = ab.FiscalYearBegin
      b.FiscalYearEnd = ab.FiscalYearEnd
    Inner Join
    (
      --get the smallest SequenceId with an unfilled AdoptedBudget
      Select min(SequenceID), 
        ProjectNumber, 
        FiscalYearBegin, 
        SubProjectNumber --any other fields needed for the join
      From Budgets b
      Where AdoptedBudget is null
      Group By 
        ProjectNumber, 
        FiscalYearBegin, 
        SubProjectNumber --any other fields needed for the join
    ) as nextBudgets
    on --the join fields again
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first question to stackoverflow so here it goes... I use cruise
Here's my first question at SO. I have a internal application for my company
Here goes a yet another SQL question about dates… I'm building a calendaring application
This is my first question on here so here goes.... I've got an issue
Here goes my first question. First of all I'm new with Java and still
First question, here goes nothing... I'm trying to add a new entry to my
My first question on this site, here goes: I am working on a tutorial
first question here. I'm developing a program in C# (.NET 3.5) that displays files
First question here: it is a very short yet fundamental thing in Java that
First question here so hello everyone. The requirement I'm working on is a small

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.