How can we help you today? How can we help you today?

AbortOnWarningLevel Options in Sync-DatabaseSchema

I recently had to delete some columns from a table that were no longer required.
The loss of data from those columns wasn't an issue as the columns were not in use.

Our powershell script failed with the following message:-
Sync-DatabaseSchema, SQL Change Automation 4.0.19274.11021, Copyright ¶¸ Red Gate Software Ltd 2014-2019
WARNING: (High) This deployment drops the column(s) [AntigenIdImported], 
[OldAntigenDescription], [ParentAntigenIdImported], [InterpretedTypeImported] 
and [BwAntigenTypeIdImported] from table [dbo].[reftblAntigens]. Data in these 
column(s), will be lost unless additional steps are taken to preserve it.
Sync-DatabaseSchema : There are warnings that have caused the operation to 
abort:
(High) This deployment drops the column(s) [AntigenIdImported], 
[OldAntigenDescription], [ParentAntigenIdImported], [InterpretedTypeImported] 
and [BwAntigenTypeIdImported] from table [dbo].[reftblAntigens]. Data in these 
column(s), will be lost unless additional steps are taken to preserve it.
To force the operation to succeed regardless of warnings, set the 
'AbortOnWarningLevel' parameter to None.
I duly set the AbortOnWarningLevel option to None and the sync worked.

My question is, what do the various AbortOnWarningLevel Options mean in practice?

Could I have used a different option other than None when columns are being deleted?


Redshift
0

Comments

4 comments

  • DanC
    Hi @Redshift

    So there's a number of different warning levels that prevent deployments from going through and will be aborted, based on the warning level set by yourself.

    In this case, the warning for data loss was "High" and so rather than "None" I think you could have used at least "Medium"

    The options are the following:

    Use this parameter to set the minimum warning level that will cause the sync operation to abort.

    Valid warning severity levels are:

    - High

    - Medium

    - Low

    - Information

    - None (do not abort for any warnings)

    The default setting is 'High'.


    https://documentation.red-gate.com/sca/reference/powershell-cmdlets/sync-databaseschema


    DanC
    0
  • Redshift
    Hi Dan,

    We hadn't set a warning level it was using the default.

    My specific question related to what is caught by the different warning severity levels.
    i.e. what is caught by high that isn't caught by medium or what is caught by medium that isn't caught by low.

    Only when I know what the various severity warning levels catch can an informed decision be made as to the appropriate warning level to use.

    Obviously 'none' is the sledgehammer approach and forces things through so it's a case of finding the right balance.

    The documentation reference you've provided doesn't provide enough detail to make an informed decision.


    Redshift
    0
  • DanC
    Hi @Redshift

    Apologies, the following documentation should help provide the information you're after.

    https://documentation.red-gate.com/sc/deploying-data-sources/deployment-warnings/full-list-of-deployment-warnings
    DanC
    0
  • Redshift
    Thanks Dan
    Redshift
    0

Add comment

Please sign in to leave a comment.