Home > php教程 > php手册 > 用sql命令修改数据表中的一个字段为非空(not null)的语句

用sql命令修改数据表中的一个字段为非空(not null)的语句

WBOY
Release: 2016-06-13 12:15:37
Original
2374 people have browsed it



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

table1 表名 
name 字段名 为什么加上[],因为name是sql关键字会冲突出现错误,这样以防万一。

如果name字段已经创建了索引,如果需要修改的话,必须先删除索引才能正确的进行。

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template