sunlunhao

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

分类:

技术点:

相关文章:

  • 2021-06-17
  • 2021-12-10
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
猜你喜欢
  • 2021-09-22
  • 2022-01-15
  • 2021-06-20
  • 2021-11-29
  • 2022-02-16
  • 2021-11-24
  • 2021-08-20
相关资源
相似解决方案