Home > Backend Development > PHP Tutorial > notnull Use sql command to modify a field in the data table to be non-null not null statement

notnull Use sql command to modify a field in the data table to be non-null not null statement

WBOY
Release: 2016-07-29 08:42:56
Original
1506 people have browsed it

 用sql命令修改数据表中的一个字段为非空not null的语句
ALTER TABLE table1 ALTER COLUMN [name] varchar(60) NULL;
table1 table name
name field name Why add [], because name is a sql keyword and an error will occur due to conflict, 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.

The above introduces the notnull statement of using sql command to modify a field in the data table to be non-null, including the notnull content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template