diff --git a/SyncChanges/Synchronizer.cs b/SyncChanges/Synchronizer.cs index 5968d34..013694e 100644 --- a/SyncChanges/Synchronizer.cs +++ b/SyncChanges/Synchronizer.cs @@ -387,7 +387,7 @@ private void Replicate(DatabaseInfo source, IGrouping destin private void ReenableForeignKeyConstraint(Database db, ForeignKeyConstraint fk) { Log.Debug($"Re-enabling foreign key constraint {fk.ForeignKeyName}"); - var sql = $"alter table {fk.TableName} with check check constraint {fk.ForeignKeyName}"; + var sql = $"alter table {fk.TableName} with check check constraint [{fk.ForeignKeyName}]"; if (!DryRun) db.Execute(sql); } @@ -395,7 +395,7 @@ private void ReenableForeignKeyConstraint(Database db, ForeignKeyConstraint fk) private void DisableForeignKeyConstraint(Database db, ForeignKeyConstraint fk) { Log.Debug($"Disabling foreign key constraint {fk.ForeignKeyName}"); - var sql = $"alter table {fk.TableName} nocheck constraint {fk.ForeignKeyName}"; + var sql = $"alter table {fk.TableName} nocheck constraint [{fk.ForeignKeyName}]"; if (!DryRun) db.Execute(sql); }