Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server - How make allow NULL value in column

I'm newbie level in SQL Server

I want to allow null value in column, but it can't save.

enter link description here

So I will re-create a new table with same structure.

Please your help to allow null value in column with SQL script. Thank you..

like image 849
Afif Pratama Avatar asked Sep 03 '26 13:09

Afif Pratama


1 Answers

It looks as though the designer is trying to re-create the whole table and warning you about that.

It is possible to allow it to do so by disabling the option specified in the error message to "prevent saving changes that require the table to be recreated" but there is no need for this here.

You can just run

ALTER TABLE SAMPLE_UPL
  ALTER COLUMN KORESKI VARCHAR(300) NULL

Or simply

ALTER TABLE SAMPLE_UPL
  ALTER COLUMN KORESKI VARCHAR(300) 

(as altering an existing column always sets it to allow NULL unless explicitly specified otherwise)

like image 135
Martin Smith Avatar answered Sep 05 '26 04:09

Martin Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!