/* Legacy to Data Mart Scripts
These are sample scripts that allow you to perform the update from SQL.
Please note, use these scripts at your own risk, and please be sure to make a backup before you begin!
*/
--Run all scripts against the ManagementReporter database.
--PLEASE make a backup of the Management Reporter Database
/* Selects list of Companies
- remove Reporting. for PRE-CU13 databases */
SELECT ID, Code, Name
FROM Reporting.ControlCompany --CU13 and higher
/* Select a list of Reports and Tree’s that will be affected
- remove Reporting. for PRE-CU13 databases */
SELECT *
FROM Reporting.ControlReport
WHERE CompanyID=(SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO') --CU13 and higher
/* Selects affected Tree Definitions
- remove Reporting. for PRE-CU13 databases */
SELECT *
FROM Reporting.ControlTreeDetail
WHERE CompanyID=(SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO') --CU13 and higher
/* Update Reports currently set at 'TWO-Curr' to 'TWO' company
- remove Reporting. for PRE-CU13 databases */
UPDATE Reporting.ControlReport
SET CompanyID= (SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO-Curr')
WHERE CompanyID= (SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO') --CU13 and higher
/* Update Trees currently set at 'TWO-Curr' to 'TWO' company
- remove Reporting. for PRE-CU13 databases */
UPDATE Reporting.ControlTreeDetail
SET CompanyID= (SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO-Curr')
WHERE CompanyID= (SELECT [ID] FROM Reporting.ControlCompany WHERE [Code] = 'TWO') --CU13 and higher