有问题文章留言 看内容决定收费与免费
另外接收数据库质疑 勒索病毒数据恢复等项目。

库存查询按大类查询偶尔查询数据不全

【问】库存查询按大类查询偶尔查询数据不全
【适用版本】专卖店9 【模块】基础业务 【点击数】14
【知识编号】Z2015122500024
【问题描述】库存查询按大类查询偶尔查询数据不全,需要多查询几次才会全。不是经常出

【答】 请备份数据库后执行以下语句后反馈查询情况
use isszmv9
go
—修复索引
use isszmv9–数据库名请根据修复的数据库进行更换。
go
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
–修复主键
use isszmv9
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

赞(0)
未经允许不得转载:思迅软件知识库 » 库存查询按大类查询偶尔查询数据不全

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址