添加数据库补丁

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

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgjwdg.html