金蝶KIS專(zhuān)業(yè)版常用SQL語(yǔ)句
2020-02-26 02:57:59
由于結束初始化后很多參數不能在金蝶軟件里直接修改,所以要借助SQL查詢(xún)分析器。
1.允許負庫存
Update t_systemprofile Set FValue=0 where FCategory='IC' And FKey='UnderStock'
Fvalue = 1 不允許負庫存
Fvalue = 0 允許負庫存
2.庫存更新控制
Update t_systemprofile set FValue=0 where FCategory='IC' and FKey='UPSTOCKWHENSAVE'
Fvalue = 0 單據審核后更新
Fvalue = 1 單據保存后更新
*****************************************************************************
*****************************************************************************
一客戶(hù)新建立帳套,錄入物料及數量后,代碼作大的變更,需要重新導過(guò),因為其他系統正常,就采用了刪除物料,重新導入的方法:
1.刪除倉庫數據,
若啟用了業(yè)務(wù)系統,刪除delete from icbal
若沒(méi)有啟用業(yè)務(wù)系統,刪除delete from IcInvbal
2.刪除BOM表
delete from ICbomChild
delete from Icbom
delete from ICBomgroup
3.刪除物料;
要刪除物料,先刪除附屬信息表。
select * from t_icitembase where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitembase where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemcore where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemcustom where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemdesign where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemmaterial where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemplan where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemquality where fitemid in (select Fitemid from t_item where fitemclassid=4)
delete from t_icitemstandard where fitemid in (select Fitemid from t_item where fitemclassid=4)
--其中Fitemclassid為4,是表示4代表物料類(lèi)。接下來(lái)刪除物料;
delete from t_item where fitemclassid=4 or fitemclassid=2001
--其中2001代表物料的成本對象。
然后重新導入數據即可!記得刪除數據前一定要備份!
*****************************************************************************
下面是刪除固定資產(chǎn)卡片的語(yǔ)句,這些語(yǔ)句是在K/3v10.3里執行的,同樣適用于KIS專(zhuān)業(yè)版,清空固定資產(chǎn)卡片:
--刪除固定資產(chǎn)卡片余額表
delete from t_FACard
delete from t_FACardItem
delete from t_FADept
delete from t_FAOrgFor
delete from t_FAVoucher
delete from t_FAExpense
delete from t_FAClear
delete from t_faalter --主表
-----刪除固定資產(chǎn)表
delete from t_FABalCardItem