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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:50:26+00:00 2026-05-22T00:50:26+00:00

BACKGROUND: I should preface this by saying I’m not trying to get someone to

  • 0

BACKGROUND:

I should preface this by saying I’m not trying to get someone to do my work for me. I feel like I’m at a bit of a crossroad where there are multiple ways to get to my goal, but I’m not sure which ones are ‘standard’ and/or if my relatively limited knowledge is lacking.

I’ve got a system that’s been evolving for six months now, and since Jan 11, the DB schema has been pretty stable. (I was never sure if I was making a major mistake creating a database for each month to correspond with monthly accounting cycles, but I just didn’t have the know-how to do otherwise)

NOW:

My boss is asking me to create year to date reports consisting of records from all the monthly databases.

WHAT I STARTED DOING:

I put together a meta data schema and populated it with enough information that I could write an application to perform ETL operations.

Here’s what it looks like:

USE [DAMain1]
GO
CREATE TABLE AccountingPeriod (
    Id INT PRIMARY KEY NOT NULL,
    Name VARCHAR(255) NOT NULL UNIQUE,
    DateStart DATE NOT NULL,
    DateStop DATE NOT NULL
)
GO
INSERT INTO AccountingPeriod VALUES 
     (1, 'Jan11', '1/1/2011', '1/31/2011')
    ,(2, 'Feb11', '2/1/2011', '2/28/2011')
    ,(3, 'Mar11', '3/1/2011', '3/31/2011')
    ,(4, 'Apr11', '4/1/2011', '4/30/2011')
    ,(5, 'May11', '5/1/2011', '5/31/2011')

CREATE TABLE [DBServer] (
    Id INT PRIMARY KEY NOT NULL,
    Name VARCHAR(255) NOT NULL UNIQUE
)
GO
INSERT INTO DBServer VALUES
    (1, 'Aaron.directagents.local')
GO
CREATE TABLE [DBInstance] (
     Id INT PRIMARY KEY NOT NULL
    ,DBServerId int NOT NULL REFERENCES DBServer(Id)
    ,SchemaName VARCHAR(255) NOT NULL
    ,CatalogName VARCHAR(255) NOT NULL
    ,ConnectionString VARCHAR(2000) NOT NULL
)
GO
INSERT INTO DBInstance VALUES
     (1, 1, 'dbo', 'DADatabaseR2', 'Data Source=aaron\sqlexpress;Initial Catalog=DADatabaseR2;Integrated Security=True')
    ,(2, 1, 'dbo', 'DADatabaseR3', 'Data Source=aaron\sqlexpress;Initial Catalog=DADatabaseR3;Integrated Security=True')
    ,(3, 1, 'dbo', 'DADatabaseMarch11', 'Data Source=aaron\sqlexpress;Initial Catalog=DADatabaseMarch11;Integrated Security=True')
    ,(4, 1, 'dbo', 'DADatabaseApr11', 'Data Source=aaron\sqlexpress;Initial Catalog=DADatabaseApr11;Integrated Security=True')
GO
CREATE TABLE DADB (
    Id int PRIMARY KEY NOT NULL,
    Name VARCHAR(255) NOT NULL UNIQUE,
    AccountingPeriodId int NOT NULL REFERENCES AccountingPeriod(Id),
    DBInstanceId INT NOT NULL REFERENCES DbInstance(Id)
)
GO
INSERT INTO DADB VALUES
     (1, 'Direct Agents Database for January 2011', 1, 1)
    ,(2, 'Direct Agents Database for February 2011', 2, 2)
    ,(3, 'Direct Agents Database for March 2011', 3, 3)
    ,(4, 'Direct Agents Database for April 2011', 4, 4)
GO
CREATE VIEW DADBs AS
SELECT
     DA.Name [Database]
    ,AP.Name [Accounting Period]
    ,AP.DateStart [Start]
    ,AP.DateStop [Stop]
    ,DS.Name [Server]
    ,DI.SchemaName
    ,DI.CatalogName
    ,DI.ConnectionString [Connection]
FROM
    DADB DA
    INNER JOIN AccountingPeriod AP ON DA.AccountingPeriodId=AP.Id
    INNER JOIN DBInstance DI ON DA.DBInstanceId=DI.Id
    INNER JOIN DBServer DS ON DI.DBServerId=DS.Id
GO
SELECT * FROM DADBs
GO

PROBLEM:

I don’t know if this is a reasonable/normal way of going about it. I have enough time to ramp up on one thing, but I can’t figure out on my own what path to go down.

QUESTION: Given that I need to pull line item data and aggregate over multiple databases as I explained, are there alternatives to defining meta data tables that drive custom ETL solutions? (for my purposes a C# app and a SSIS project are eqiv, but I’m interested to know if one might use Analysis Services or Reporting Services here)

  • 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-22T00:50:27+00:00Added an answer on May 22, 2026 at 12:50 am

    Bad database designs often rear themselves in reporting. As you have discovered, having the data for each month in separate databases has created a reporting nightmare. Imagine what would happen if the accounting cycle dates change? The better solution would be to consolidate the data into a single database where you determine the accounting cycle based attributes of the entries (date entered, date posted etc.).

    In the interim, given what you have, I’d say the best solution is to create a consolidated database and fill it using SSIS from the other databases until you can update the middle-tiers or UIs to use the consolidated design.

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

Sidebar

Related Questions

The background should be transparent, but the text should not.
Background I am trying to create a copy of a business object I have
Background I work for a large organization which has thousands of MS Access applications
Background: I'm trying to implement a messenging system in my app, and I'm writing
I have this CSS rule: #panelSeparator .active { background: #fff url(../img/vgrabber.gif) no-repeat center; opacity:
I come from SML background and feel quite comfortable with high-order functions. But I
I have a div I want when user clicks on this div the background
Background: I have a little video playing app with a UI inspired by the
Background: At my company we are developing a bunch applications that are using the
Background: Some time ago, I built a system for recording and categorizing application crashes

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.