Use the SQL command to modify the statement that a field in the data table is not null

  • 2020-03-31 20:47:41
  • OfStack

< img border = 0 SRC = "http://files.jb51.net/upload/201006/20100604183928749.jpg" border = 0 >

ALTER TABLE table1 ALTER COLUMN [name] varchar(60) NULL;

Table1 table name  
Why do you add [] to the name field name? Because the name is the SQL keyword, there will be an error, just in case.

If an index has been created for the name field, it must be dropped before it can be modified properly.


Related articles: