--增加分类 GO IF not EXISTS(SELECT * FROM SYS_ScriptCategories WHERE id=1) insert into SYS_ScriptCategories(ID,Code,Name,ComponentID,xRowNum,ParentID,xLevel,Description) Values(1, 'SC1', 'HOMaster 基础管理', 1, 0, 0, 0, Null) else print 'SYS_ScriptCategories.id=1 已经存在.' GO --删除旧记录 delete from SYS_Scripts where id=2099 --删除脚本内容 GO GO IF not EXISTS(SELECT * FROM SYS_Scripts WHERE id=2099) insert into SYS_Scripts(ID,CategoryID,Code,Name,Description,xType,DatasourceID,DisplayNames,xRowNum,xText,UpdateDate,UpdateUser,UpdateMode) Values(2099, 31, 'Sql_母婴医嘱分类', Null, '母婴医嘱分类', 1, 0, Null, 1, 'declare @VAA01 int,@VAA07 int set @VAA01 = %d set @VAA07 = %d SELECT Cast(0 as integer) FID,Cast(0 as integer) VAF07, Convert(varchar(20),''本人'') FName, ''1'' as IfDef UNION ALL SELECT VAP01,VAP01 VAF07,VAP05,''0'' FROM VAP1 where VAA07 = @VAA07', '2017-04-26 09:01:27', '(8088)王海涛', 0) else print 'SYS_Scripts.id=2099 已经存在.' GO