在线客服
热线电话
  • 0719-8020960

    技术园地 网站首页> 技术园地

    思迅商云8按交易查询或者按单退货要等一分钟才有反应

    分享到:
    更新时间:2022年03月01日15:20:21 打印此页 关闭
    摘要: 【问题描述】客户使用了好几年了,分部,按交易查询或者按单退货要等一分钟才有反应,反应很慢【问题答案】请先备份数据库,然后执行下面语句,修复完毕后再重新测试:use 数据库名---修复索引declare @tablename varchar(100)declare  test_cur cursor forselect object_name(id) ...

    【问题描述】

    客户使用了好几年了,分部,按交易查询或者按单退货要等一分钟才有反应,反应很慢

    【问题答案】

    请先备份数据库,然后执行下面语句,修复完毕后再重新测试:
    use 数据库名
    ---修复索引
    declare @tablename varchar(100)
    declare  test_cur cursor for
    select object_name(id) from sysobjects
    where type ='U'
    open test_cur
    fetch test_cur into @tablename
    while @@fetch_status=0
    begin  
       DBCC DBREINDEX(@tablename)
       fetch test_cur into @tablename
    end
    close test_cur
    deallocate test_cur
    go
    --修复自增列
    declare @tablename varchar(100)
    declare  test_cur cursor for
    select object_name(id) from syscolumns
    where status=128
    open test_cur
    fetch test_cur into @tablename
    while @@fetch_status=0
    begin  
       DBCC CHECKIDENT (@tablename, RESEED)  
       fetch test_cur into @tablename
    end
    close test_cur
    deallocate test_cur
    go
    注:修复索引会给服务器造成很大压力,并且较为耗时,执行过程中会影响到前后台客户端的操作,建议在门店断网模式下处理或营业结束时处理,先执行修复索引,索引修复完毕后在执行修复自增列,修复自增列的红色错误信息可以忽略。