Ignoring Triggers

WubtiWubti Posts: 4
edited August 31, 2016 2:20AM in ReadyRoll
I am trying to get readyroll to ignore some Triggers. I followed the advice from this thread viewtopic.php?f=199&t=79386

Looking in the .sqlproj, I can see the section in question:
<ExcludeObjectsFromImport>
      Assembly=[myschemaname];
      Credential=[mycredential];
      DatabaseDdlTrigger=[ddltriggername];
      Default=[dbautil].[(.*?)];
      PartitionFunction=[mypartitionfunction];
      PartitionScheme=[mypartitionfunction];
      Role=[myrole];
      Rule=[dbautil].[(.*?)];
      Schema=[dbautil];
      Sequence=[dbautil].[(.*?)];
      StoredProcedure=[dbautil].[(.*?)];
      Synonym=[dbautil].[(.*?)];
      Table=[dbautil].[(.*?)];
     [b] Trigger=[dbautil].[(.*?)];[/b]
      User=[myusername];
      UserDefinedDataType=[dbautil].[(.*?)];
      UserDefinedFunction=[dbautil].[(.*?)];
      View=[dbautil].[(.*?)];
      XmlSchemaCollection=[dbautil].[(.*?)];
      
      Contract=[myservicebrokercontract];
      EventNotification=[myservicebrokereventnotification];
      MessageType=[myservicebrokermessagetype];
      Queue=[myservicebrokerqueue];
      RemoteServiceBinding=[myservicebrokerremotebinding];
      Route=[myservicebrokerroute];
      Service=[myservicebrokerservice];
      
    </ExcludeObjectsFromImport>

I can see that it includes a regular expression for Trigger. So, I set my project setting to
<ExcludeObjectsFromImport>
	Trigger=(.*?);
	Synonym=(.*?);
	</ExcludeObjectsFromImport>
I also tried
<ExcludeObjectsFromImport>
	Trigger=[dbo].[(.*?)];
	Synonym=(.*?);
	</ExcludeObjectsFromImport>
Synonyms are correctly excluded, but my triggers are still being included. I need to handle the trigger separately because it updates a foreign database via synonym and at initial install that database does not exist yet. I cannot install the foreign database first because it too has references back to this database.... (Don't ask why, I just inherited this mess and need to get the installers working).

In the end, I am looking for the option "Ignore DML triggers" in SQL Compare, which works exactly as expected.

Any help at all will be appreciated.
Tagged:

Comments

Sign In or Register to comment.