A More Efficient way to Update Report Data Sources

,

During an upgrade, re-pointing all your LBI reports to your new database may seem like a daunting task. Never fear! You don’t have to do it manually (at least not all of them). Here are the steps to overwrite your data sources using a SQL update query:

  1. Create an ODBC connection on your LBI server that connects to your NEW database server.
    1. Don’t forget that you have to use the 32-bit ODBC tool for LBI data sources!
  2. Create your new data source in LBI
    1. Tools > Reporting Services Report Administration > Server Administration > New Data Source A More Efficient way to Update Report Data Sources_2
  3. Open SQL Server Management Studio (or whatever database management tool you use)
  4. Log-in to your LBI database server
  5. Navigate to the LawsonRS databaseA More Efficient way to Update Report Data Sources_3
  6. BACK UP YOUR ERS_REPORTDATASOURCES TABLE! (You should always back up the table or the database if you are making changes directly)
  7. Run a query to view all the reports for which you plan to change the data source: A More Efficient way to Update Report Data Sources_4
  8. When you are ready, run your update query using the same WHERE clause that you used when you viewed your reports in step 7
    A More Efficient way to Update Report Data Sources_5

    1. NOTE: you are updating RSDATASOURCE. This is so that the report data source will be overridden.
    2. If you have a new username & password for this data source, you will also need to update the DEFAULTUSER and DEFAULTPASSWORD fields as well.
  9. Now your reports should run against the new data source. There are a few cases in which you will need to manually reset the data source in Crystal and republish the report. They are:
    1. If your report mixes schemas (i.e. it uses tables owned by dbo, and views owned by xyz)
    2. If your report has subreports
    3. If your report has a command that explicitly defines the database name (and the database name has changed)
    4. There may be more, but these are the instances that I discovered on a recent upgrade!