sadier

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

几个要点:
0、客户端到临时表是通过bcp运行而传输数据的。
1、存储过程中从临时表插入到Branch表是通过PKId 和BranchNo来表示唯一性的。而真实配方表是从Branch表插入的,通过比较SchemaNo 和BranchNo来表示唯一性。对应有两种情况
1.1色母订单是通过比较SchemaNo 和BranchNo来表示唯一性。
1.2对于色粉订单如果修改了配方明细,本条订单将传送不到,所以应通过PKId 和BranchNo来表示唯一。
此时会出现一个问题:色粉的配方插入以后,配方编号会有重复,因此必须把以前的配方都删掉。

客户端:
select Count(OperateDate) As CountInComeBill from WebErp.dbo.TBL_InComeBill 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountInComeDetail from WebErp.dbo.TBL_InComeDetail 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

 select   Count(OperateDate) As CountOrder from WebErp.dbo.TBL_Order 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountOrderDrawOut  from WebErp.dbo.TBL_OrderDrawOut 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchema from WebErp.dbo.TBL_Schema 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchemaDetail  from WebErp.dbo.TBL_SchemaDetail
 where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY'

临时表:
select  Count(OperateDate) As CountInComeDetail from LocalWebErp.dbo.TBL_InComeDetailBranch_Temp   
 where OperateDate > '2004-7-31' and OperateDate < '2004-8-1'  And BranchNo = 'YY' ;

 select   Count(OperateDate) As CountOrder  from LocalWebErp.dbo.TBL_OrderBranch_Temp   
 where OperateDate > '2004-7-31' and OperateDate < '2004-8-1'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountOrderDrawOut  from LocalWebErp.dbo.TBL_OrderDrawOutBranch_Temp   
 where OperateDate > '2004-7-31' and OperateDate < '2004-8-1' And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchema  from LocalWebErp.dbo.TBL_SchemaBranch_Temp  
 where OperateDate > '2004-7-31' and OperateDate < '2004-8-1'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchemaDetail from LocalWebErp.dbo.TBL_SchemaDetailBranch_Temp  
 where OperateDate > '2004-7-31' and OperateDate < '2004-8-1' And BranchNo = 'YY'


服务器端:
select Count(OperateDate) As CountInComeBill from LocalWebErp.dbo.TBL_InComeBillBranch 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountInComeDetail from LocalWebErp.dbo.TBL_InComeDetailBranch  
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

 select   Count(OperateDate) As CountOrder  from LocalWebErp.dbo.TBL_OrderBranch  
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountOrderDrawOut  from LocalWebErp.dbo.TBL_OrderDrawOutBranch  
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchema  from LocalWebErp.dbo.TBL_SchemaBranch 
where OperateDate > '2004-7-22' and OperateDate < '2004-7-23'  And BranchNo = 'YY' ;

select  Count(OperateDate) As CountSchemaDetail from LocalWebErp.dbo.TBL_SchemaDetailBranch 
 where OperateDate > '2004-7-22' and OperateDate < '2004-7-23' And BranchNo = 'YY'

posted on 2004-08-01 13:19  毛小华  阅读(762)  评论(0)    收藏  举报