You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DSWMS/DB/sqlserver/清空仓储业务数据.sql

145 lines
3.3 KiB
Transact-SQL

select * from OP_WMS_IN_PLAN
select * from OP_WMS_IN_PLAN_GOODS
select * from OP_WMS_IN_DO
select * from OP_WMS_IN_DO_GOODS
select * from OP_WMS_PHYSICS_DODETAIL
select * from OP_WMS
select * from OP_WMS_CHANGE
select * from OP_WMS_PHYSICS
select * from OP_WMS_PHYSICS_CHANGE
select * from OP_WMS_LOGIC
select * from OP_WMS_LOGIC_LOG
select * from OP_WMS_MOVE
select * from OP_WMS_MOVE_DETAIL
select * from OP_WMS_TRANSFERGOODS
select * from OP_WMS_TRANSFERGOODS_DETAIL
select * from OP_WMS_CHECK
select * from OP_WMS_CHECK_DETAIL
select * from OP_WMS_FEE
select * from OP_WMS_FEECALENDAR
select * from OP_WMS_FEEDUI_STORAGE_DETAIL
select * from OP_WMS_FEEDUI_STORAGE
select * from OP_WMS_OUT_PLAN_BEFORE
select * from OP_WMS_OUT_PLAN
select * from OP_WMS_OUT_PLAN_DETAIL
select * from OP_WMS_OUT_DO
select * from OP_WMS_OUT_DO_GOODS
select * from OP_WMS_OUT_DO_BSNO
select * from OP_WMS_WORKDETAIL
select * from info_files
select * from OP_WMS_WEIGH
select * from OP_WMS_WEIGH_DETAIL
select * from info_files
select * from OP_WMS_STOREHOUSE
select * from OP_WMS_STOREHOUSE_AREA
select * from OP_WMS_STOREHOUSE_AREA_POSITION
select * from OP_WMS_FEERATE_DETAIL where FEERATEID not in (select FEERATEID from OP_WMS_FEERATE)
/*
delete from OP_WMS_IN_PLAN
delete from OP_WMS_IN_PLAN_GOODS
delete from OP_WMS_IN_DO
delete from OP_WMS_IN_DO_GOODS
delete from OP_WMS_PHYSICS_DODETAIL
delete from OP_WMS
delete from OP_WMS_CHANGE
delete from OP_WMS_PHYSICS
delete from OP_WMS_PHYSICS_CHANGE
delete from OP_WMS_LOGIC
delete from OP_WMS_LOGIC_LOG
delete from OP_WMS_MOVE
delete from OP_WMS_MOVE_DETAIL
delete from OP_WMS_TRANSFERGOODS
delete from OP_WMS_TRANSFERGOODS_DETAIL
delete from OP_WMS_CHECK
delete from OP_WMS_CHECK_DETAIL
delete from OP_WMS_FEE
delete from OP_WMS_FEECALENDAR
delete from OP_WMS_FEEDUI_STORAGE_DETAIL
delete from OP_WMS_FEEDUI_STORAGE
delete from OP_WMS_OUT_PLAN_BEFORE
delete from OP_WMS_OUT_PLAN
delete from OP_WMS_OUT_PLAN_DETAIL
delete from OP_WMS_OUT_DO
delete from OP_WMS_OUT_DO_GOODS
delete from OP_WMS_OUT_DO_BSNO
delete from OP_WMS_OUT_DO_BSNO
--delete from ch_fee
delete from OP_WMS_WORKDETAIL
--delete from info_files
delete from OP_WMS_FEEPAYINFO
--delete from OP_WMS_STOREHOUSE
--delete from OP_WMS_STOREHOUSE_AREA
--delete from OP_WMS_STOREHOUSE_AREA_POSITION
delete from OP_WMS_FEERATE_DETAIL where FEERATEID not in (select FEERATEID from OP_WMS_FEERATE)
----<2D><><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>԰<EFBFBD><D4B0><EFBFBD>˾ɾ<CBBE><C9BE>
declare @corpid varchar(50)
set @corpid='Com2f3952aa23cc48d2ab96b1f4d54d819e'
--select * from OP_WMS_IN_PLAN where corpid=@corpid
--select * from OP_WMS_IN_PLAN_GOODS
delete from OP_WMS_IN_DO where corpid=@corpid and Creator='<27>Թ<EFBFBD>ɭ'
--select * from OP_WMS_IN_DO_GOODS
--select * from OP_WMS_PHYSICS_DODETAIL
delete from OP_WMS where corpid=@corpid and Creator='<27>Թ<EFBFBD>ɭ'
--select * from OP_WMS_CHANGE
--select * from OP_WMS_PHYSICS
--select * from OP_WMS_PHYSICS_CHANGE
delete from OP_WMS_IN_DO_GOODS where not exists(select 1 from OP_WMS_IN_DO where WMSDOID=OP_WMS_IN_DO_GOODS.WMSDOID)
delete from OP_WMS_CHANGE where not exists(select 1 from OP_WMS_IN_DO where WMSDOID=OP_WMS_CHANGE.DOBSNO)
delete from OP_WMS_PHYSICS where not exists(select 1 from OP_WMS where WMSID=OP_WMS_PHYSICS.WMSID)
delete from OP_WMS_PHYSICS_CHANGE where not exists(select 1 from OP_WMS where WMSID=OP_WMS_PHYSICS_CHANGE.WMSID)
*/