Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add default constraint in code
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01547085
Message ID:
01547086
Vues:
33
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform