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

產(chǎn)品手冊 實施方案 用戶案例 問題中心

合同消息提醒數(shù)據(jù)庫表變更

— 檢測最近兩個月消息表,如果有,則檢測是否 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 )
? ? — 設(shè)置 同步標記 為 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 )
? ? — 設(shè)置 同步標記 為 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 )
? ? — 設(shè)置 同步標記 為 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 )
? ? — 設(shè)置 同步標記 為 Y
? ? Set @strSQL = ‘UPDATE ‘ + @strDBTable + ‘ SET C_SYNC = ”1”’
? ? EXEC( @strSQL )
? END
?END
END
GO
標簽:腳本 上一篇: 下一篇:
展開更多
預(yù)約軟件體驗

loading...

<p id="6rpsm"><font id="6rpsm"></font></p>
    1. <menuitem id="6rpsm"><center id="6rpsm"></center></menuitem>

      <noframes id="6rpsm">

        主站蜘蛛池模板: 南宫市| 潼关县| 普格县| 遂昌县| 随州市| 汽车| 谢通门县| 新巴尔虎右旗| 江安县| 五华县| 依安县| 平凉市| 秦皇岛市| 四会市| 朝阳市| 武邑县| 延津县| 内丘县| 峡江县| 广元市| 宜宾县| 丁青县| 额敏县| 和静县| 汽车| 乌鲁木齐县| 林甸县| 同江市| 镇宁| 毕节市| 武义县| 宜川县| 福建省| 祥云县| 泰兴市| 十堰市| 唐河县| 徐闻县| 名山县| 云梦县| 岳阳市|