exec [dbo].[usp_sqlwatch_user_add_report] /* Title of the report: */ ,@report_title ='Disk Utilisation Report'/* Description: */ ,@report_description =''/* Single Query or an entire Template: */ ,@report_definition ='select [Volume]=[volume_name] ,[Days Until Full] = [days_until_full] ,[Total Space] = [total_space_formatted] ,[Free Space] = [free_space_formatted] + " (" + [free_space_percentage_formatted] + ")" ,[Growth] = [growth_bytes_per_day_formatted] from [dbo].[vw_sqlwatch_report_dim_os_volume]'/* Type of the report, either Template or Query: */ ,@report_definition_type ='Query'/* Assosiate with an existing action: */ ,@report_action_id =-1
Alternatively we can insert directly into the report table:
insert into [dbo].[sqlwatch_config_report]values (...)
Modify existing report
To modify existing report we can either update the report table:
Note that you cannot delete a report if an action is using it. You will first have to remove that action or update the [action_report_id] so it does not reference that report