What are the challenges you face when working across database platforms? Take the survey

Incorrect script with Drop Table and function

I use Source Control on Git Repository. I set up Filter.scpf and commit changes. I have several migration scripts.
When i generate deploy script with SQL Compare(V in deploy script have drop instruction for table constraints. And "DROP TABLE [dbo].[Sessions]" instruction. Next in the script there is an instruction "ALTER TABLE [dbo].[Sessions] ADD
[Step] [nvarchar] (max) COLLATE Cyrillic_General_CI_AS NULL". But this table is already removed.

There are also instructions for removing the function, which is used as the default value in the table, without removing the default limit. This also causes an error when running the script. The function and table are specified in the Filter.scpf.

Let's assume that this may be due to the addition of existing objects in the database(tables and functions) in the Filter.scpf. And SqlCompare does not take into account Filter changes.scpf between revisions. And applies the Filter.scpf from the last revision to all stages of the deployment script generation. In the first comments, the table or function has not yet been added to the Filter.spf and therefore SqlCompare generates an incorrect deployment script with the deletion of the object in the database.
Is there any way around this error? or will there be an update to fix this error?


  • Options
    Hi @deproblue

    Before we can investigate this further, could you please update to the latest version (–Dec 27th, 2023)

    It's possible this behaviour may be different, if not I can reach out to look into this

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

Sign In or Register to comment.