Deploy from RG Source Control: Don't want to drop objects

Hi, 
when deploying from build artifact,  is it possible to prevent dropping objects which don't exist on the source? 
Something like /exclude:Additional in SQL compare command line. 



Tagged:

Best Answer

  • Kendra_LittleKendra_Little Posts: 139 Gold 3
    Hi JTR,

    Have you checked out New-DatabaseReleaseArtifact and Use-DatabaseReleaseArtifact?

    New-DatabaseReleaseArtifact has an -IgnoreAdditional option which sounds possibly like what you're looking for, the description is:
    Specifies whether to ignore additional objects in the target database. Enabling this prevents new and unexpected objects in the target being dropped - note that the checks and tests applied to this database may not have taken those objects into account and may therefore not be valid.
    This parameter can't be used simultaneously with filter files.

    If you know what the objects are that you'd like to skip, personally I'd test using -FilterPath on New-DatabaseReleaseArtifact to specify a filter file of what to ignore first, it seems cleaner to me.

    The great thing about these cmdlets is that you can export and review the database release artifact to make sure it's doing exactly what you want before using it anywhere. Very nice when it comes to testing which option is right for you.

    Kendra

Answers

  • JTRJTR Posts: 5 New member
    Hi Kendra,
    I'm currently trying with TFS task (RG Change Automation - Deploy changes from build artifact) and -IgnoreAdditional parameter is not exposed in UI. But I'll switch to using powershell cmdlets it this is the only way. 
    I want to prevent dropping because often someone creates some temporary table(which are eventually dropped).  For the known objects that shouldn't be deployed, I already tried filters and it works fine. 
    Thanks for help, 
    Janez 
  • JTRJTR Posts: 5 New member
    Looks like  -IgnoreAdditional and -FilterPath are not compatible.  
  • Thanks for the extra info, JTR. You can do this in TFS as well -- there is a "SQL Change Automation: Release" plug-in which has these components / is the equivalent of these PowerShell cmdlets, just in case you haven't found that yet. 

    And yep, it's either filters or ignore additional. 
Sign In or Register to comment.