0

When generating a diff script between two dbschema with vsdbcmd.exe, I sometime obtain an unexpected output, containing some drop constraint without the name of the constraint :

GO
PRINT N'Dropping On column: ColumnName ...';    

GO
ALTER TABLE TableName DROP CONSTRAINT ;

In our schema, this column has a default value constraint, with an auto generated name. I expected vsdbcmd.exe to generate a valid ALTER TABLE sql statement, as specified in the msdn library :

ALTER TABLE [ database_name . [ schema_name ] . | schema_name . ] table_name DROP { [ CONSTRAINT ] constraint_name | COLUMN column_name }

Do you have any idea of what could prevent vsdbcmd.exe to generate a valid sql statement ?

Guillaume
  • 1
  • 2
  • After further investigation, this only occurs when the constraint has an generated name. Explicitly named constrained are not impacted. – Guillaume Nov 13 '13 at 17:37

1 Answers1

0

This issue only occurs when the constraint has a generated name. Explicitly named constraint are not impacted. Therefore, this solution is to name every constraint.

Guillaume
  • 1
  • 2