Bug report: Sync-DlmDatabaseSchema seems to ignore some items in -FilterPath .scpf file

Our filter file has a filter to exclude some tables like this:

      <Table version="1">
        <Include>False</Include>
        <Expression>(@NAME = 'Table1') OR (@NAME = 'Table2') OR (@NAME = 'Table3')</Expression>
      </Table>

One of these tables had FileStream enabled for some blob data in the destination databases.
This was not the case for the source database.

The console output contains this text (3 times the same) :
Applying update to database 'db_name' Completed: 100% Progress completed9 of 439

(Medium) Table [dbo].[Table2] contains filestream data in column COLUMN_X. The table must be rebuilt. The data in the table apart from dropped columns will be preserved.
(Medium) Table [dbo].[Table2] contains filestream data in column COLUMN_X. The table must be rebuilt. The data in the table apart from dropped columns will be preserved.
(Medium) Table [dbo].[Table2] contains filestream data in column COLUMN_X. The table must be rebuilt. The data in the table apart from dropped columns will be preserved.

The data was not lost but was converted to normal blob data, and the FileStream property was removed from the column.

Our command line was like this:
Sync-DlmDatabaseSchema -Target New-DlmDatabaseConnection -ServerInstance "SqlServerName" -Database "SqlDatabaseName" -Source "structPackage.nupkg" -FilterPath "FilterRulesRedGate.scpf" -SQLCompareOptions "IgnoreFullTextIndexing,  UseClrUdtToStringForClrMigration, IgnoreCollations, IgnoreUsersPermissionsAndRoleMemberships, -ForceColumnOrder" -AbortOnWarningLevel None


Best Answer

  • Sergio RSergio R Posts: 610 Rose Gold 5
    Hi Louis,

    You can overrule dependencies by disabling the IncludeDependencies SQL Compare option.
    You just need to add "-IncludeDependencies" as a SQL Compare option on the cmdlet.
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools

Answers

  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Hi,
    Thank you for your forum post.

    Have you by any chance deployed an object or objects that references or has a dependency on the filtered object?

    If yes, objects excluded by the filter are  included in the deployment as dependencies. If an excluded object is referenced by an object you selected for deployment.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Hi Eddie,

    Thank you for your reply.

    Does this mean that we have to exclude all stored procedures and functions that use the table?
    Also all procedures and functions that use those procedures and functions recursively?

    I don't think this would be a viable solution.
    In my opinion there should be an option to have the .scpf file overrule dependencies (enabled by default).
Sign In or Register to comment.