添加数据库补丁

--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') 

begin
ALTER TABLE Ris_contrastagentusedinfo ADD DrugType char(1);

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'备注名称',
'user', @CurrentUser, 'table', '表名', 'column', '字段名'
end
go

posted @ 2015-07-02 16:15  小孙^_^  阅读(169)  评论(0编辑  收藏  举报