Sql-server – Fetch data from SQL Server table of the ERP DB

data-warehousedatabase-designsql-server-2005stored-procedures

I have pretty old ERP system running on SQL Server 2005 (about 20GB database. Largest able has 2 million rows). Unfortunately, the ERP can't run on SQL Server 2008 or newer. I have a huge amount of legacy systems as well. Some of them are VBA frontend and stored procedures as backend and business logic. Some of them are C# applications. I know it is a very bad approach and I'm looking for better solution. I fetch data directly from ERP DB with SELECT WITH (NOLOCK).

If one day (hopefully soon) I will have to replace my ancient ERP with a new one, it will be a nightmare to update thousands of stored procedures, VBA and C# code.

The only solution I can think about is a definition of objects. For example, I plan to maintain P/N table which will hold all my part numbers and relevant data. On another hand, I have to merge the data from ERP to the P/N table every 5 minutes (either SSIS or stored procedure) to keep it updated. It is a huge load on my ERP DB. Considering tremendous amount of objects (warehouses, inventory data, logistics and financial transactions, engineering data) this approach will kill my ERP DB.

Can you propose a better solution?

Best Answer

If you really want to move lots of data off the source server often, maybe you should consider the db's native solution of

  • Replication.

You can organize it to push only what you want it to push.
It is made to operate in parallel to normal operation. There are lots of configurations to balance getting it thorough versus not bothering the server too much (at both ends). It can do things like read transactions logs with separate Services, avoiding running queries through the db engine at all.

There's a ton of information out there.
You can start with the official stuff at:
https://technet.microsoft.com/en-us/library/ms151198(v=sql.90).aspx
It walks you through a lot of the options, including
choosing an overall Replication type,
and considerations for Data Warehousing and Reporting scenarios.

Any internet search for more help on Replication, including on SO, will turn up a lot more.