Hopefully the title has made it quite clear.
I would like to see an example of a alter table statement that can change an existing non-nullable column in a Sybase table to nullable.
ALTER TABLE table_name ALTER COLUMN column_name DATA_TYPE [(COLUMN_SIZE)] NULL; In this syntax: First, specify the name of the table from which you want to change the column. Second, specify the column name with size which you want to change to allow NULL and then write NULL statement .
The following statement changes the default value of a column named OrderDate from its current setting to CURRENT DATE: ALTER TABLE SalesOrders ALTER OrderDate DEFAULT CURRENT DATE; You can remove column defaults by modifying them to be NULL.
Modifying the NULL default value of a column:
If you are changing only the NULL default value of a column, you do not need to specify a column's datatype
(Switching the example from the above link):
alter table authors
modify address null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With