SQL Azure fires a trigger when restoring from bacpac - by Jan Vilímek

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


6
0
Sign in
to vote
ID 781674 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 3/19/2013 7:44:44 AM
Access Restriction Public

Description

We have several triggers on our tables. One of many is like 

CREATE TRIGGER yyyy ON xxx FOR INSERT, UPDATE, DELETE AS RAISERROR(''You are not allowed to modify the table xxx',13,1); ROLLBACK TRAN;

This table contains data. When  the database is backed up to BACPAC via Azure management portal, it goes fine. When we try to restore such BACPAC, it throws an error because the trigger is fired when inserting data to the table.

This is wrong. We have several triggers that guards DB integrity (business logic beyond FK keys, constraints) and we need to have such triggers in DB.
The correct way is to DISABLE all triggers before inserting (bulkinsert?) data from BACPAC.


PS: few moths back everything was fine when restoring BACPAC while having triggers in DB model
Sign in to post a comment.
Posted by Jan Vilímek on 4/11/2014 at 1:49 AM
Martin, thanks for information. Do you know the ETA for this? I have reproduced the error on SQL Server Management Studio 2014 with the Azure database 11.0.9208
BR Jan
Posted by Microsoft on 2/11/2014 at 9:00 PM
Jan,

Thank you for the feedback. We have fixed this now by disabling and reenabling triggers during the data deployment phase. It will be available in the next major release of DacFx.

Thanks,

Martin