物料清单子件出现重复
- 浏览:2059 - 发布时间:2008-09-23 08:26:00.0
问题版本: |
85-U6普及版3.2 |
问题模块: |
848-生产制造 |
所属行业: |
0-通用 |
问题状态: |
1-UU通注册用户 |
关 键 字: |
物料清单子件出现重复 |
适用产品: |
85 |
补 丁 号: |
|
开放状态: |
0-UU通注册用户 |
原问题号: |
|
提交时间: |
2008-9-23 8:26:00 |
问题名称: |
物料清单子件出现重复 |
问题现象: |
U6普及版3.2系统个别物料清单子件出现重复。例如:查看数据,物料母件编码4B05,子件中12010916出现两个,12011112出现两个。 |
原因分析: |
请备份好帐套执行如下语句,此语句没有考虑版本号(查你的帐,只有母件编码是4701,4706版本号区开,且子件没有重复记录)及自由项(帐套中没有自由项)! declare @cPSPcode varchar(100) declare @PScode varchar(100) declare @AuToID varchar(100) declare TEST_cursor cursor for SELECT cPSPcode,cPScode FROM ProductStructures GROUP BY cPSPcode,cPScode HAVING COUNT(cPScode)>1 open TEST_cursor FETCH NEXT FROM TEST_cursor INTO @cPSPcode,@PScode while @@fetch_status=0 BEGIN SET @AuToID=(SELECT TOP 1 AuToID FROM ProductStructures WHERE cPSPcode=@cPSPcode AND cPScode=@PScode) DELETE ProductStructures WHERE AuToID=@AuToID FETCH NEXT FROM TEST_cursor INTO @cPSPcode,@PScode END CLOSE TEST_cursor DEALLOCATE TEST_cursor |
解决方案: |
请备份好帐套执行如下语句,此语句没有考虑版本号(查你的帐,只有母件编码是4701,4706版本号区开,且子件没有重复记录)及自由项(帐套中没有自由项)! declare @cPSPcode varchar(100) declare @PScode varchar(100) declare @AuToID varchar(100) declare TEST_cursor cursor for SELECT cPSPcode,cPScode FROM ProductStructures GROUP BY cPSPcode,cPScode HAVING COUNT(cPScode)>1 open TEST_cursor FETCH NEXT FROM TEST_cursor INTO @cPSPcode,@PScode while @@fetch_status=0 BEGIN SET @AuToID=(SELECT TOP 1 AuToID FROM ProductStructures WHERE cPSPcode=@cPSPcode AND cPScode=@PScode) DELETE ProductStructures WHERE AuToID=@AuToID FETCH NEXT FROM TEST_cursor INTO @cPSPcode,@PScode END CLOSE TEST_cursor DEALLOCATE TEST_cursor | |