Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Multiple Database Problem 2

$
0
0

Hi All,

I'm looking for some general advice on writing SQL statements to solve a problem with data being stored in multiple databases.  Without going into too much detail, the company I work for manufactures and sells oilfield products that are assembled and sold to customers and serviced many times throughout the products life-cycle.  We wrote a tracking system in C# MVC that allows the customer to login and see a complete service history for all their product and where they have been deployed to the oilfield.

The company has recently acquired some smaller competitors and plans to rebrand them as branches of our company.  They plan to migrate their systems to our ERP system but, keep their information in a separate database.  It will be highly probable that service information for products will be split over 2 different databases (and, potentially more in future).  which poses a huge problem for the tracking website.  I know separate databases is an extremely bad way to store the information but I have little to no decision making power over the situation.

The data in the website has to be real-time so I cannot build a data warehouse to collate the information.  I know I can write UNION queries inside the MVC app and pull the data from multiple databases into to a dataset (which I know datasets are frowned upon in MVC).  I could also write a view that pulls information from multiple databases and presents it to MVC as single table which might make life easier.  I could also write some kind of loop that would automatically create a union query from a single select statement however, the existing select statements are already complex with multiple grouping and in some cases, already contain UNTION statements to combine data from multiple tables.  Anyone have any other ideas?

We have a website written in C# MVC that currently pulls data from the USA or Canada database depending on the users login.  Now, for the USA locations, the data could be spread across 3 diff


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>