Search code examples
sql-serverdatabase-schemasql-server-data-toolsdac

DacFX\SDDT - Disable Trigger operation inverted


I have a table with an update trigger in it that must be updated. The text of the update needs changed and the trigger must be left disabled.

For some reason when I run a Dac Deploy operation the software OMITS the disabling of the trigger in the analysis and the deploy. He does update the text, but he enables the trigger!

The trigger is already disabled, but he enables it! What the heck?

Is this a known issue or something?

I am just using a straightforward operation that works on almost every other case

[PublishResult] $PublishResult = $DacServices.Publish( $DacPackage, $TargetDatabaseName, $PublishOptions ) 

I have a restore and execute operation test case setup. This happens every time I run it.

Restore DB: Trigger is disabled after restore Execute: 5 Operations complete without errors Test: Trigger text is updated as expected, but trigger is enabled

Happens every time I run this test. I am thinking it's a bug


Solution

  • This is expected behavior of MS Sql Server. Performing ALTER statements on disabled triggers will implicitly enable the trigger.