Enhance support for default constraints
I need to replicate a database for read-only reporting purposes and the production database is littered with all sorts of default constraints.
For example:
ALTER TABLE [schema].[table] ADD CONSTRAINT [DFtablecolumn] DEFAULT ('Unknown') FOR [column].
This is what the definition is in SSMS.
In SQL Compare:
[column] [varchar] (15) COLLATE SQLLatin1GeneralCP1CIAS NOT NULL CONSTRAINT [DFtable_column] DEFAULT -- No text is available,
Now the constraint fails AND the comma separator for the next line is missing.
Another fun one:
[SCD Surrogate Hash Key] AS (CONVERT([varbinary](64),hashbytes('SHA2_512',coalesce(CONVERT([varbinary](50),[column]),0x00)+0x0001))) PERSISTED NOT NULL,
And SQL Compare loses all track and produces this:
[SCD Surrogate Hash Key] AS PERSISTED NOT NULL,
As I need to transfer almost 300 tables and all of them have these kind of issues, I've had to regex a lot in Powershell to work around these issues. But a bit more support on these cases would be much appreciated :).