Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add default constraint in code
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01547085
Message ID:
01547086
Views:
32
Create constraint in SSMS but instead of Save click on Generate Script button

>I have a table where I added a default in SSMS. So the default has a constraint name (e.g. 'DF_table_name_col_name')
>
>Now I wanted to drop this default constraint and create a new one; in code. Dropping it seems to be easy. But when I try to create the new default constraint in code I get error. Here is syntax I use:
>
>
>alter table table_name alter column col_name char(20) not null add constraint [DF_table_name_col_name] default ('')
>
>
>What is wrong with my syntax above? TIA.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform