Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've done this often, and let me tell you, keeping separate databases is a PAIN IN THE ASS. It forces you to do all sorts of logic like this all over the place - it sort of breaks the encapsulation that is a database in the first place. </p> <p>What you are looking at is a data warehouse. You should look into consolidating all of your databases into one, and making it read-only. Then you take nightly/hourly incremental backups of your live data, and restore that against your warehouse. Then your warehouse is always up to date, and you run your reporting against that, instead of the live data. </p> <p>This has the upshot of keeping your reports from killing your live production databases, and I'd guess upwards of 90% of business needs don't require 100% accurate just-in-time numbers. </p> <p>Do the hard stuff once - create a warehouse. :-) </p> <p><strong>EDIT</strong></p> <p>Something I've done in the past is to create a view of the tables I use, and using linked databases (if the dbs were on other machines) </p> <pre><code>Create view view_tale as select * from activedb.dbo.table union select * from db1.dbo.table union select * from db2.dbo.table </code></pre> <p>Hideous, performance-wise, but solves the problem neatly. Then you still only have the one-time setup issue (creating a view per table you wsish to query), and a centralized place to modify to keep your database list up to date for ongoing maintenance, as opposed to keeping N number of reports up to date.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload