Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem adding a new column with constraint
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01327737
Message ID:
01329002
Views:
14
>What if:
>
>IF NOT EXISTS(SELECT column_name
>                     FROM INFORMATION_SCHEMA.COLUMNS
>              WHERE TABLE_NAME = N'Volunteers' and COLUMN_NAME = N'IsActive')
>   BEGIN
>        alter table Volunteers
>              add IsActive bit NOT NULL CONSTRAINT [DF_Volunteers_IsActive]  DEFAULT (1)
>   END
>
Didn't try that, though it doesn't address the original problem. I can drop the field and re-try this syntax, though.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform