--增加分类 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=7362 --删除脚本内容 GO GO IF not EXISTS(SELECT * FROM SYS_Scripts WHERE id=7362) insert into SYS_Scripts(ID,CategoryID,Code,Name,Description,xType,DatasourceID,DisplayNames,xRowNum,xText,UpdateDate,UpdateUser,UpdateMode) Values(7362, 31, 'Sql_获取材料发药科室', '', '发送医嘱获取材料发药科室', 1, 1, Null, 1, 'select distinct a.BCK01D from VAJ2 a where a.VAJ48 = 0 and a.BDN01 in (''4'',''M'') and a.VAI01 in (%s)', '2014-07-01 16:29:21', '(8088)王海涛', 0) else print 'SYS_Scripts.id=7362 已经存在.' GO