I'm using a SQL Server Database Project with Visual Studio 2012 and have the following problem when comparing and generating an update script:
In Visual Studio, I add a column with a default constraint, for example:
[NewColumn] NVARCHAR(50) CONSTRAINT [DF_ExistingTable_NewColumn] NOT NULL DEFAULT N''
Unfortunately, the name of the default constraint does not appear when:
- Comparing (Schema Compare) my project with the actual database
- Generating an update script (from within the Schema Compare)
The created update script contains the following script (no constraint name):
ALTER TABLE [dbo].[ExistingTable]
ADD [NewColumn] NVARCHAR (50) DEFAULT N'' NOT NULL;
This seems like a major oversight, so I'm wondering where to find the magic switch to include the names of default constraints in all database operations.