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

Was this helpful?

  1. SQLWATCH Database
  2. Known Issues

Database drift

PreviousCollation conflictNextLogin failed error when running disk logger

Last updated 6 years ago

Was this helpful?

In some cases, you may receive the following error when upgrading from DacPac:

Database has drifted from its registered data-tier application

When SQLWATCH is deployed, it registers itself as data-tier application, which adds a record in msdb.dbo.sysdac_instances.

This is userful to identify currently installed version of SQLWATCH.

The error may happen when database objects have been changed since the last deployment, for example, when you deploy SQLWATCH into your existing "dba_tools" database and add or remove some other tables, not related to SQLWATCH.

Unregister Data-Tier Application

To work around this issue, we have to unregister data-tier application. This can be done in SQL Server Management Studio:

Right click database -> Tasks -> Delete Data-Tier Application

Alternatively, you can use T-SQL to achieve the same:

declare @instance_id uniqueidentifier

declare @database_name sysname = 'SQLWATCH'



select @instance_id = instance_id

from msdb.dbo.sysdac_instances dp 
where dp.instance_name = @database_name



exec dbo.sp_sysdac_delete_instance 
	
    @instance_id = @instance_id


    
exec dbo.sp_sysdac_update_history_entry 
	
    @action_id=21,
	
    @instance_id=@instance_id,
	
    @action_type=14,
	
    @dac_object_type=0,
	
    @action_status=2,
	
    @dac_object_name_pretran=@database_name,
	
    @dac_object_name_posttran=@database_name,
	
    @sqlscript=NULL,
	
    @error_string=N''