Home Dashboard Directory Help
Search

SSDT Schema Comparison needs to handle Database Triggers first by Mark Freeman


Status: 

Active


3
0
Sign in
to vote
Type: Bug
ID: 773683
Opened: 12/6/2012 8:29:10 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

When generating a publish script from a schema comparison where there has been a change to a database trigger, the ALTER for that trigger needs to be the first statement in the main body of the script, do that it is in effect when all of the other statements run. It is currently generated last, just before the calls to sp_refreshsqlmodule.

I am using the SQL Server Data Tools 10.3.20905.0 in Visual Studio 2010 SP1, comparing the project schema with a SQL Server 2005 SP4 database.
Details
Sign in to post a comment.
Posted by Microsoft on 2/28/2013 at 3:28 PM
Hey Mark,

Thanks for your feedback around the incorrect scripting/deployment ordering when dealing with modifying database level triggers in this case. The SSDT/DACFx team is not currently pursuing a fix for this issue, however, we have an item tracking it should it come up for future consideration. The workaround for this issue is to manually alter the generated deployment script so that the database trigger is refreshed in the appropriate order.

Thanks,
Adam Mahood
Program Manager
SQL Server Database Systems
Sign in to post a workaround.