initialize new fields (default value)

Forum for users of SQL Compare schema synchronization utility

initialize new fields (default value)

Postby THA » Mon Jul 23, 2007 8:26 am


i am new in sql compare 6. i have tried it.
Now I have the following question:
Is it possible to (automatically) initialize/set default values to new fields in the updated database.
For example: for numeric fields set default value to zero (0).
Another "problem" is:
One table gets a new (additional) key field. How can I initialize this field, too?

thanks in advance!

regards, tha
Posts: 1
Joined: Mon Jul 23, 2007 8:06 am

Postby Michelle Taylor » Tue Jul 24, 2007 10:55 am

I'm afraid there isn't currently a way to automatically initialize newly added fields with default values. It's a feature we've been considering adding in future releases, and I'll add this thread to the feature request.

Currently the obvious workaround is to add a default constraint to the field in the source database, but we understand that isn't the best solution if you don't want the field to have a default after the synchronization is complete.

You can also save the synchronization script / ask Compare to load it in Query Analyzer or Management Studio and then edit the script by hand to have a default constraint added and then dropped from the column.
Michelle Taylor
Posts: 535
Joined: Mon Oct 30, 2006 11:45 am
Location: Red Gate Software

Postby David Atkinson » Mon Oct 17, 2011 11:00 pm

SQL Compare 9.5 with SQL Source Control 3 allows custom scripts that override default behavior. This should allow you to make any modifications you like, such as setting a default value. ... 1312#51312

Kind regards,

David Atkinson
Product Manager
Red Gate Software
David Atkinson
Posts: 1136
Joined: Mon Dec 05, 2005 3:54 pm
Location: Twitter: @dtabase

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests