--1.添加字典类别
IF NOT EXISTS(SELECT * FROM PUB_DICTIONARYCATEGORY WHERE CATEGORYID='135')INSERT INTO PUB_DICTIONARYCATEGORY(CATEGORYID,CATEGORYCODE,CATEGORYNAME,ISMODIFY,CATEGORYTYPE) VALUES('135','3132','lalala','0','0001')GO--2添加字段并备注
if not exists(select * from syscolumns where id=object_id('Ris_contrastagentusedinfo') and name='DrugType')beginALTER TABLE Ris_contrastagentusedinfo ADD DrugType char(1);
declare @CurrentUser sysname
select @CurrentUser = user_name() execute sp_addextendedproperty 'MS_Description', '备注名称', 'user', @CurrentUser, 'table', '表名', 'column', '字段名'endgo