当天有销售,日结提示“没有日结处理数据”
请先备份数据库,然后执行下面语句,修复完毕后再重新测试:
use hbposev9
---修复索引
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
注:修复索引会给服务器造成很大压力,并且较为耗时,执行过程中会影响到前后台客户端的操作,建议在门店断网模式下处理或营业结束时处理,先执行修复索引,索引修复完毕后在执行修复自增列,修复自增列的红色错误信息可以忽略。