【脚本】二代程序,总部打散分小批次下载数据
2018-08-27    易林江
1172 0
由于部分同步指令数据量执行较大,可以将数据打扫分成小批次指令执行到门店同步
  • 执行脚本

    Declare C CURSOR Scroll 
    FOR
    Select Code From CRM_Customer Where ShopCode<>门店编号 and (IsShare='1' Or ICCardNumbers>0)
    Open C
    Declare @tempCustomerCode nvarchar(100)

    Declare @temp int
    Set @temp=10000

    FETCH NEXT From C INTO @tempCustomerCode
    while(@@FETCH_sTATUS=0)
    begin

        Set @temp =@temp+10

        dECLARE @countOfPrice int
        SElect @countOfPrice = COUNT(1) From CRM_NegotiatedPrice Where CustomerCode = @tempCustomerCode

        IF(@countOfPrice IS NOT NULL and @countOfPrice>0)
        Begin

        Declare @condition nvarchar(100)
        Set @condition = ' CustomerCode='''+@tempCustomerCode+''' '

            
            EXEC SYS_SyncPusHToShop_insert
        106,
                'CRM_NegotiatedPrice',
                'Id',
                '*',
                @temp,
                'Update',
                @condition,'','',
                10
            
        END

        FETCH NEXT From C INTO @tempCustomerCode
    end

    close c
    dEALLOCATE c

章节

该文章对您有用吗?

非常感谢,您的反馈对我们很有价值!

客服电话

4006757966

微信公众号

联系我们

印特3系演示版

申请

印特5系演示版

申请

免费试用

印特软件标准演示版下载申请

请您填写您的一些信息,提交您的申请后,我们会在两个工作日内进行处理,并回复您一封邮件,内附下载链接,请您注意查收。
*
请输入正确的公司名称
*
请输入正确的联络人员
*
请输入正确的联络电话
提交申请
关闭