亚洲一区影音先锋色资源,成人毛片免费观看视频在线,日韩亚洲国产激情在线观看

產品手冊 實施方案 用戶案例 問題中心

合同消息提醒數據庫表變更

分類:產品中心 產品手冊 實施方案 994
— 檢測最近兩個月消息表,如果有,則檢測是否 C_SYNC 字段,如果沒有,則自動增加此字段
BEGIN
?declare @strDate as char(6)
?declare @strDBTable as varchar(24)
?declare @strSQL as varchar(1024)
?— Mobile 本月消息表
?Set @strDate = left( Convert( char(8), GetDate(), 112 ), 6 )
?Set @strDBTable = ‘OI_STK_MOBILE_MSG_’ + @strDate
?IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(@strDBTable) AND OBJECTPROPERTY(id, N’IsUserTable’) = 1)
?BEGIN
? IF NOT EXISTS (select * from syscolumns where id = object_id(@strDBTable) and name= ‘C_SYNC’)
? BEGIN
? ? Set @strSQL = ‘ALTER TABLE ‘ + @strDBTable + ‘ ADD [C_SYNC] [char](1) NOT NULL CONSTRAINT DF_STK_MBMSG_’ + @strDate + ‘_C_SYNC DEFAULT ”0”’
? ? EXEC( @strSQL )
? ? — 設置 同步標記 為 Y
? ? Set @strSQL = ‘UPDATE ‘ + @strDBTable + ‘ SET C_SYNC = ”1”’
? ? EXEC( @strSQL )
? END
?END
?— STK 本月消息表
?Set @strDBTable = ‘OI_STK_MSG_’ + @strDate
?IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(@strDBTable) AND OBJECTPROPERTY(id, N’IsUserTable’) = 1)
?BEGIN
? IF NOT EXISTS (select * from syscolumns where id = object_id(@strDBTable) and name= ‘C_SYNC’)
? BEGIN
? ? Set @strSQL = ‘ALTER TABLE ‘ + @strDBTable + ‘ ADD [C_SYNC] [char](1) NOT NULL CONSTRAINT DF_STK_MSG_’ + @strDate + ‘_C_SYNC DEFAULT ”0”’
? ? EXEC( @strSQL )
? ? — 設置 同步標記 為 Y
? ? Set @strSQL = ‘UPDATE ‘ + @strDBTable + ‘ SET C_SYNC = ”1”’
? ? EXEC( @strSQL )
? END
?END
?— Mobile 上個月消息表
?Set @strDate = left( Convert( char(8), DATEADD( MONTH, -1, GetDate() ), 112 ), 6 )
?Set @strDBTable = ‘OI_STK_MOBILE_MSG_’ + @strDate
?IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(@strDBTable) AND OBJECTPROPERTY(id, N’IsUserTable’) = 1)
?BEGIN
? IF NOT EXISTS (select * from syscolumns where id = object_id(@strDBTable) and name= ‘C_SYNC’)
? BEGIN
? ? Set @strSQL = ‘ALTER TABLE ‘ + @strDBTable + ‘ ADD [C_SYNC] [char](1) NOT NULL CONSTRAINT DF_STK_MBMSG_’ + @strDate + ‘_C_SYNC DEFAULT ”0”’
? ? EXEC( @strSQL )
? ? — 設置 同步標記 為 Y
? ? Set @strSQL = ‘UPDATE ‘ + @strDBTable + ‘ SET C_SYNC = ”1”’
? ? EXEC( @strSQL )
? END
?END
?— STK 上個月消息表
?Set @strDBTable = ‘OI_STK_MSG_’ + @strDate
?IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(@strDBTable) AND OBJECTPROPERTY(id, N’IsUserTable’) = 1)
?BEGIN
? IF NOT EXISTS (select * from syscolumns where id = object_id(@strDBTable) and name= ‘C_SYNC’)
? BEGIN
? ? Set @strSQL = ‘ALTER TABLE ‘ + @strDBTable + ‘ ADD [C_SYNC] [char](1) NOT NULL CONSTRAINT DF_STK_MSG_’ + @strDate + ‘_C_SYNC DEFAULT ”0”’
? ? EXEC( @strSQL )
? ? — 設置 同步標記 為 Y
? ? Set @strSQL = ‘UPDATE ‘ + @strDBTable + ‘ SET C_SYNC = ”1”’
? ? EXEC( @strSQL )
? END
?END
END
GO
標簽:腳本 上一篇: 下一篇:
展開更多
預約軟件體驗

loading...

    1. 
      
        1. <blockquote id="pnys9"></blockquote>
          <dfn id="pnys9"><var id="pnys9"></var></dfn>
          主站蜘蛛池模板: 汉沽区| 曲周县| 盐池县| 股票| 永泰县| 泌阳县| 含山县| 枞阳县| 宜川县| 宝坻区| 扶绥县| 黎川县| 前郭尔| 临颍县| 泽库县| 竹溪县| 读书| 新建县| 阳东县| 汶川县| 大港区| 屏边| 荔浦县| 佛山市| 九江市| 锦州市| 育儿| 苍梧县| 宁津县| 湖州市| 萝北县| 铁岭县| 麻阳| 南平市| 台东县| 石台县| 重庆市| 江都市| 宜州市| 辉县市| 峡江县|