数据库在新建表的时候添加注释comment on column

格式:

1
comment on column 表名.字段名 is '注释';

demo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
create TABLE HPD_INSTOCK_TEMP
(
StoreHouseID varchar(20) ,
DeptCode varchar(20),
InStockCode varchar(20),
InStockCodeLine numeric(4,0),
DrugCode varchar(20),
Unit varchar(20),
Count Numeric(10,2),
Price Numeric (10,4),
SellPrice Numeric (10,4),
Total Numeric (16,4),
Manufacture varchar(100),
Validity varchar(10),
FactDate date,
Remark varchar(100),
Operator varchar(20),
CZJC char(1)
);

comment on column HPD_INSTOCK_TEMP.StoreHouseID is '药库编码';
comment on column HPD_INSTOCK_TEMP.DeptCode is '药房编码';
comment on column HPD_INSTOCK_TEMP.InStockCode is '退库单号';
comment on column HPD_INSTOCK_TEMP.InStockCodeLine is '序号';
comment on column HPD_INSTOCK_TEMP.DrugCode is '药品编码';
comment on column HPD_INSTOCK_TEMP.Unit is '计量单位';
comment on column HPD_INSTOCK_TEMP.Count is '数量';
comment on column HPD_INSTOCK_TEMP.Price is '进货价';
comment on column HPD_INSTOCK_TEMP.SellPrice is '零售价';
comment on column HPD_INSTOCK_TEMP.Total is '金额';
comment on column HPD_INSTOCK_TEMP.Manufacture is '生产厂家';
comment on column HPD_INSTOCK_TEMP.Validity is '失效日期';
comment on column HPD_INSTOCK_TEMP.FactDate is '退货日期';
comment on column HPD_INSTOCK_TEMP.Remark is '备注';
comment on column HPD_INSTOCK_TEMP.Operator is '操作员工号';
comment on column HPD_INSTOCK_TEMP.CZJC is '操作进程';