alter table Add Column with Default

Learn how to avoid a DSI error when you issue the alter table command in the active database to add a column with a default value.

When you issue the alter table command in the active database to add a column with a default value, Adaptive Server creates a constraint with an auto-generated name. When the command is replicated to the standby database, the standby database also creates the same constraint with another, different auto-generated name. When you drop the constraint in the active database, the standby database does not recognize the constraint name and generates a data server interface (DSI) error.

To avoid this, drop the constraint in the active database first. The data server interface (DSI) shuts down automatically. Then drop the constraint created in the standby database and issue the resume dsi skip transaction command.

An alternative workaround is to execute:

alter table table name 
replace column name 
default null

This automatically drops the constraints created on both active and standby sites.