Home  >  Article  >  Backend Development  >  Use sql command to modify a field in the data table to be non-null (not null)_PHP tutorial

Use sql command to modify a field in the data table to be non-null (not null)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:37:101595browse

Use sql command to modify a field in the data table to be non-null (not null)_PHP tutorial

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

table1 table name
Why is [] added to the name field name, because name is SQL keyword conflicts will cause errors, just in case.

If an index has been created for the name field, if it needs to be modified, the index must be deleted first to proceed correctly.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322002.htmlTechArticleALTER TABLE table1 ALTER COLUMN [name] varchar(60) NULL; table1 table name name why field name is added with [ ], because name is a sql keyword, an error will occur due to conflict, just in case. If...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn