-3

I am facing an issue while entering data into column which has been set nullable false,How can I change this to nullable true using sql .I am using mysql database

1 Answers1

0

Use this:

ALTER TABLE MYTABLE CHANGE COLUMN MYCOLUMN MYCOLUMN VARCHAR(10) NULL;

MYTABLE is the table name, MYCOLUMN is the column name. The important bit is the NULL at the end, that will make the column nullable. Note that you have to repeat the whole column definition. I used VARCHAR(10) in the example, but you have to adapt it to your column, setting default value and other options, if necessary.

Marcovecchio
  • 1,322
  • 9
  • 19