Oracle、Mysql、SqlServer创建表和给表和字段加注释
一、Oracle
--创建表create table test ( id varchar2(200) primary key not null, sort number, name varchar(200))--字段加注释comment on column test.id is 'id'; comment on column test.sort is '序号';--表加注释comment on table test is '测试表' |
二.Mysql
--创建表create table test ( id varchar(200) not null, sort int(11) comment '排序', name varchar(200) comment '名称',) --表加注释alter table test comment ='测试表' |
三.SqlServer
--创建表create table test ( id varchar(200) primary key not null, sort int, name varchar(200),)--给字段加注释EXEC sp_addextendedproperty N'test', N'序号', N'user', N'dbo', N'table', N'test', N'column', N'sort'; --表加注释EXECUTE sp_addextendedproperty N'test', N'测试表', N'user', N'dbo',N'table', N'test', NULL, NULL |

浙公网安备 33010602011771号