if not exists(select * from syscolumns where name = 'CAP01' and object_Name(id)='CFE1') alter table CFE1 add CAP01 int -- 段落分类 Go IF NOT EXISTS (SELECT * FROM syscolumns WHERE name = 'BQZ35' AND OBJECT_NAME( id ) = 'BQZ1') ALTER TABLE BQZ1 ADD BQZ35 VARCHAR(128) ; --集采信息 go IF NOT EXISTS (SELECT * FROM syscolumns WHERE name = 'BQZ36' AND OBJECT_NAME( id ) = 'BQZ1') ALTER TABLE BQZ1 ADD BQZ36 VARCHAR(64) ; --商品条形码 go if not exists(select * from syscolumns where name = 'ZJB19' and object_Name(id)='ZJB1') begin Alter table ZJB1 Add ZJB19 smallint default(0) with values end go if not exists(select * from syscolumns where name = 'ZJB20' and object_Name(id)='ZJB1') begin Alter table ZJB1 Add ZJB20 VARCHAR(100) end go if not exists(select * from syscolumns where name = 'ZJB19' and object_Name(id)='ZJB1_2') begin Alter table ZJB1 Add ZJB19 smallint default(0) with values end go if not exists(select * from syscolumns where name = 'ZJB20' and object_Name(id)='ZJB1_2') begin Alter table ZJB1_2 Add ZJB20 VARCHAR(100) end go if not exists(select * from syscolumns where name = 'BBY56' and object_Name(id)='MSB2') begin Alter table MSB2 Add BBY56 tinyint end go --增加分类 GO IF EXISTS(SELECT * FROM SYS_ScriptCategories WHERE id=25) Delete from SYS_ScriptCategories WHERE id=25 insert into SYS_ScriptCategories(ID,Code,Name,ComponentID,xRowNum,ParentID,xLevel,Description) Values(25, 'SC25', '配置管理HOHMID', 2, 0, 0, 0, Null) GO --删除旧记录 delete from SYS_Scripts where id=26687 --删除脚本内容 GO GO IF EXISTS(SELECT * FROM SYS_Scripts WHERE id=26687) Delete from SYS_Scripts WHERE id=26687 insert into SYS_Scripts(ID,CategoryID,Code,Name,Description,xType,DatasourceID,DisplayNames,xRowNum,xText,UpdateDate,UpdateUser,UpdateMode,Custom,ConnectSlave) Values(26687, 25, 'Sys_Login_Msg', '登录提示信息', '登录提示信息', 1, 0, Null, 1, 'SELECT Description from Core_Messages where Code=''LoginMsg''', '2023-06-08 15:18:17', '(8065)冯义强', 0, 0, 0) GO If EXISTS(SELECT * from Sys_CustomScripts WHERE ID = 26687) Update a SET a.Custom = b.Custom from SYS_Scripts a join Sys_CustomScripts b on b.ID = a.ID where a.ID=26687 GO --增加分类 GO IF EXISTS(SELECT * FROM SYS_ScriptCategories WHERE id=25) Delete from SYS_ScriptCategories WHERE id=25 insert into SYS_ScriptCategories(ID,Code,Name,ComponentID,xRowNum,ParentID,xLevel,Description) Values(25, 'SC25', '配置管理HOHMID', 2, 0, 0, 0, Null) GO --删除旧记录 delete from SYS_Scripts where id=27584 --删除脚本内容 GO GO IF EXISTS(SELECT * FROM SYS_Scripts WHERE id=27584) Delete from SYS_Scripts WHERE id=27584 insert into SYS_Scripts(ID,CategoryID,Code,Name,Description,xType,DatasourceID,DisplayNames,xRowNum,xText,UpdateDate,UpdateUser,UpdateMode,Custom,ConnectSlave) Values(27584, 25, 'SatisfactSurveyHint', '满意度调查弹出', '满意度调查弹出', 1, 0, Null, 1, 'Declare @UserId int SET @UserId =%d SELECT UserID FROM Sys_User_LoginState WITH(NOLOCK) WHERE UserID=@UserId AND (SatisfactionSurvey IS NULL OR SatisfactionSurvey <= GETDATE())', '2024-03-20 17:38:00', '(8065)冯义强', 0, 0, 0) GO If EXISTS(SELECT * from Sys_CustomScripts WHERE ID = 27584) Update a SET a.Custom = b.Custom from SYS_Scripts a join Sys_CustomScripts b on b.ID = a.ID where a.ID=27584 GO