金蝶KIS專業(yè)版常用SQL語(yǔ)句
2020-02-26 02:57:59
由于結(jié)束初始化后很多參數(shù)不能在金蝶軟件里直接修改,所以要借助SQL查詢分析器。
1.允許負(fù)庫(kù)存
Update t_systemprofile Set FValue=0 where FCategory='IC' And FKey='UnderStock'
Fvalue = 1 不允許負(fù)庫(kù)存
Fvalue = 0 允許負(fù)庫(kù)存
2.庫(kù)存更新控制
Update t_systemprofile set FValue=0 where FCategory='IC' and FKey='UPSTOCKWHENSAVE'
Fvalue = 0 單據(jù)審核后更新
Fvalue = 1 單據(jù)保存后更新
*****************************************************************************
*****************************************************************************
一客戶新建立帳套,錄入物料及數(shù)量后,代碼作大的變更,需要重新導(dǎo)過(guò),因?yàn)槠渌到y(tǒng)正常,就采用了刪除物料,重新導(dǎo)入的方法:
1.刪除倉(cāng)庫(kù)數(shù)據(jù),
若啟用了業(yè)務(wù)系統(tǒng),刪除delete from icbal
若沒有啟用業(yè)務(wù)系統(tǒng),刪除delete from IcInvbal
2.刪除BOM表
delete from ICbomChild
delete from Icbom
delete from ICBomgroup
3.刪除物料;
要?jiǎng)h除物料,先刪除附屬信息表。
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)刪除物料;
delete from t_item where fitemclassid=4 or fitemclassid=2001
--其中2001代表物料的成本對(duì)象。
然后重新導(dǎo)入數(shù)據(jù)即可!記得刪除數(shù)據(jù)前一定要備份!
*****************************************************************************
下面是刪除固定資產(chǎn)卡片的語(yǔ)句,這些語(yǔ)句是在K/3v10.3里執(zhí)行的,同樣適用于KIS專業(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