Replicating tables within the database

48 Views Asked by At

I have table A, B and C with data that is similar, but with different structure. I need to access the data from my program (Java, in this case) and I'm thinking of having a mini-ETL process that will run daily replicating data from these three tables into a new table D (which will be accessed by my program using a single table structure). Is this approach correct?

1

There are 1 best solutions below

0
On BEST ANSWER

If you can populate D via a single query, then back a view with that query and you're done (I'm pretty sure most popular sql servers don't allow, say, procedure backed views).

Otherwise, yea, you'll have some process that turns data from a,b,c into d. That can be through stored procedures (possibly with triggers), or an external job.

If you really need your program to access a single table structure. But double check the reasons why you need this. Moving complexity from your client to your data model may not be the best solution every time.