LogoLogo
ReleasesHomepageBlogSlack
3.0
3.0
  • Welcome
  • Concept
  • SQLWATCH Database
    • Requirements
      • Permissions
      • Performance Overhead
      • Storage Utilisation
    • Installation
      • Install with dbatools
      • Install with SqlPackage
      • Install with SSMS
      • Deploy from source code
      • Optional Components
      • Upgrade
      • Removal
      • Downgrade
    • Configuration
    • Known Issues
      • Collation conflict
      • Database drift
      • Login failed error when running disk logger
      • Deadlock when creating database
    • Notifications
      • Checks
      • Actions
      • Reports
      • How To
        • Add or modify check
        • Add or modify action
        • Add or modify report
      • Process Flow
    • Large Environments
  • Central Repository
    • Requirements
      • Performance overhead on the remote instance
      • Permissions
    • Installation
      • Removal
      • Upgrade
    • Configuration
    • Known Issues
  • Power BI Dashboard
    • Requirements
      • Permissions
    • Installation
    • Configuration
    • Known Issues
      • Power BI Load Errors
    • Performance
  • Grafana Dashboard
    • Requirements
    • Installation
    • Configuration
  • Azure Log Analytics Dashboard
    • Concept
    • Requirements
    • Installation
    • Configuration
  • Design Decision
    • Relations
    • Trend Tables
    • Data Types
      • Real Type
    • Primary Keys
    • Data Compression
    • Configuration Items
    • Using Apply instead of Join
  • Reference
    • Data-Tier Application Package
  • Integrations
    • Send notifications to Slack and Teams
    • dbachecks
  • FAQ
    • How do I check if SQLWATCH is running OK?
    • I am not seeing any data in Power BI
    • Can I modify default checks?
    • The app_log is growing fast
Powered by GitBook
On this page
  • Add new report
  • Modify existing report

Was this helpful?

  1. SQLWATCH Database
  2. Notifications
  3. How To

Add or modify report

Add new report

		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:

update [dbo].[sqlwatch_config_report]
    set [report_definition] = '...'
    where report_id = 1

Or we can re-run the procedure passing the ID of the report we want to update/replace:

		exec [dbo].[usp_sqlwatch_user_add_report] 
			--pass ID of the report to update / replace:
		  ,@report_id = 1
			,@report_title = 'Disk Utilisation Report'
			,@report_description = ''
			,@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]'
			,@report_definition_type = 'Query'
			,@report_action_id  = -1

Delete Report

To delete an existing report you can simply delete it from the table which will also delete any associations:

delete from [dbo].[sqlwatch_config_report]
    where report_id = 1

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

PreviousAdd or modify actionNextProcess Flow

Last updated 5 years ago

Was this helpful?