Creating the MDX Base Report Definition
Create the base report definition using a set of INSERT statements into the Report table. The MDX query created in Step 2 is inserted into the [Query] field.
The ReportType is set to Static_MDX (3). The Protected bit is cleared (set to 0) which allows the report to be overwritten or deleted.
For more information about the Report table, see Analysis/Reporting Schema.
Step 3
DECLARE @ReportID int
DECLARE @ReportStatusID int
INSERT INTO [dbo].[Report] ([DisplayName], [Description], [ReportType],
[Category], [Query], [CreatedBy], [Protected], [Definition])
VALUES ('Visits by Referrer', 'Visits by Referrer', @Static\_MDX, 'Web Usage',
MDX Query, 'the almighty creator', 0, "Long report description goes here")
SELECT @ReportID = @@identity