Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

How should I build a DB to hold data about another database

$
0
0

I know that this is a strange question. I need ideas and/or advice, not necessarily "how-to"s.

I work with data from a 3rd party tool/database. I do not have permissions to modify this production database. Any changes or additional information that is needed that cannot go into this production database has to be housed somewhere else.

I have tables whose data has some sort of relationship to each other. For example: Let's say I have a "Caller" table that contains the caller's name and the company that they work for, and I have a "Company" table. Normally, I would use the PK on the Company table in the Caller table as an FK. In this case, that is not possible. On top of that, the Company Names may not be EXACTLY the same. For example: Kim Smith might have "ABC Distributing" as her company in the Caller table, while the Company table has the name as "ABC Dist".

I need to create a database to "support" this other database. In addition to the problem listed above, sometimes companies change names. The powers-that-be want the historical records attached to the company's name at that period in time. So if "ABC Dist" changed their name to "ABC Distribution and Manufacturing" in January 2016, the powers-that-be want the records for that company before Jan 1, 2016 to have the "ABC Dist" name, while records AFTER Jan 1, 2016 to have the new name. We now have TWO records for the same company, with two PKs. Again, this is not something that I can change. If I could rewrite this 3rd party tool, I would.

So, I need a way to keep callers associated with the correct company in the company table and a way to associate multiple lines in the same company table together (company name changes).

I know that I'll have to write an ETL to keep these two databases synchronized. What I need is ideas on how to design the support DB. Do I copy company names over or just use the PK for everything?

I hope that I've made the issues clear and understandable. I'm really frustrated with this mess, and need a way to tame it a bit.

OH! Also, I need suggestions on how to keep track of when changes are made to the production database. No one bothers to tell me changes have occurred until something downstream breaks. (Using MS SQL Server 2008 R2)

Should I have submitted this under the developers' StackOverflow?


Viewing all articles
Browse latest Browse all 17268

Trending Articles