yyl250 发表于 2008-11-14 11:06:59

删除已停用的客户,供应商.部门档案的SQL语句

删除已停用的客户,供应商.部门档案的SQL语句 txt文件

195521041 发表于 2008-11-14 11:41:33

下载,备用,谢谢

jzbaboy 发表于 2008-11-17 08:35:49

不是吧.要是以后,再来了.怎么办.

dfls 发表于 2008-11-18 15:53:40

下载,备用,谢谢

aaccaa 发表于 2008-11-24 09:21:37

连这个也上传啊.

uf7570 发表于 2008-11-26 16:57:48

学习中。。。。。。。:handshake

peng127 发表于 2008-12-20 10:38:25

不错的资料。下载学习中.....

bangjie 发表于 2008-12-24 22:46:56

恢复期末处理是不是很慢的

updata8903355 发表于 2009-1-7 13:04:29

下载学习,语句删除还是快

linshengtong 发表于 2009-1-12 10:15:19

好像不错的样子哦。

17379467360 发表于 2024-3-29 09:11:38

删除已停用的客户,供应商.部门档案的SQL语句
Delete      
from Inventory
where
          not exists(select * from CurrentStock
          where Inventory.cInvCode=CurrentStock.cInvCode)         --现存量表
      and not exists(select * from IA_Subsidiary
          where Inventory.cInvCode=IA_Subsidiary.cInvCode)      --发票表
      and not exists(select * from RdRecords
          where Inventory.cInvCode=RdRecords.cInvCode)            --收发货记录表
      and not exists(select * from pursettlevouchs
          where Inventory.cInvCode=pursettlevouchs.cInvCode)      --采购结算单子表
      and not exists(select * from sa_invuprice
          where Inventory.cInvCode=sa_invuprice.cInvCode)         --销售报价表
      and not exists(select * from Dispatchlists
          where Inventory.cInvCode=Dispatchlists.cInvCode)      --发货单列表
      and not exists(select * from ProductStructuresEx
          where Inventory.cInvCode=ProductStructuresEx.cPSPCode)--产品结构母产品
      and not exists(select * from ProductStructuresEx
          where Inventory.cInvCode=ProductStructuresEx.cPSCode)   --产品结构子产品
      and not exists(select * from PriceJustify
          where Inventory.cInvCode=PriceJustify.cInvCode)         --销售调价记录表
      and not exists(select * from SO_SODetails
          where Inventory.cInvCode=SO_SODetails.cInvCode)         --销售订单子表
      and not exists(select * from PurBillVouchs
          where Inventory.cInvCode=PurBillVouchs.cInvCode)      --采购发票子表
      and dEDate is not null                                    --已停用产品
--=======================================删除停用的客户档案
Delete            
from customer
where
          not exists(select * from Dispatchlist
          where customer.cCusCode=Dispatchlist.cCusCode)   --发货单列表
      and not exists(select * from gl_accass
          where customer.cCusCode=gl_accass.ccus_id)       --辅助总账
      and not exists(select * from GL_accvouch
          where customer.cCusCode=GL_accvouch.ccus_id)   --凭证及明细账
      and not exists(select * from SO_SOmain
          where customer.cCusCode=SO_SOmain.cCusCode)      --销售订单主表
      and not exists(select * from SA_QuoDetails
          where customer.cCusCode=SA_QuoDetails.cCusCode)--销售报价表
      anddEndDate is not null                            --已停用标志
---------------------s---o---f----t----b---b----s----.-----n---e---t----------------------
----------================================删除停用的供应商档案
Delete            
from Vendor
where
          not exists(select * from po_pomain
          where Vendor.cvencode=po_pomain.cvencode)          --采购订单主表
      and not exists(select * from gl_accass
          where Vendor.cvencode=gl_accass.csup_id)         --辅助总账
      and not exists(select * from GL_accvouch
          where Vendor.cvencode=GL_accvouch.csup_id)         --凭证及明细账
      and not exists(select * from RdRecord
          where Vendor.cvencode=RdRecord.cvencode)         --收发货记录表
      and not exists(select * from Ven_Inv_Price_Rule
          where Vendor.cvencode=Ven_Inv_Price_Rule.cvencode) --供应商报价
      anddEndDate is not null                              --已停用标志
页: [1]
查看完整版本: 删除已停用的客户,供应商.部门档案的SQL语句