Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alter table alter column Syntax
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01687733
Message ID:
01687734
Views:
33
>Hi,
>
>I am testing the following Alter command (in SSMS)
>
>alter TableName Alter ColumnName numeric (12,2) not null
>
>The result I get is what I want: the column size changes, it is not null, and The Default is set to 0 (which I did not specify above).
>Is Default set to 0 (zero) by design because my expressing says Not Null?
>
>TIA

If you have set DEFAULT before altering the column usually must drop the constraint, alter column and then put the constraint back.
I got to many errors from different versions of SQL Server when I tried to alter columns so I choose this approach.
Maybe different versions handle this differently but I don't risk anymore.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform