金蝶实施服务常用sql语句

作者: seamus 分类: 金蝶 发布时间: 2018-05-05 11:07

— 在所有SQL命令中,如果数据对象的数据类型为非数值的,则必须加上单引号‘’。单据类型,其他出库单FTranType=29,销售出库单FTranType=21
select * from ICStockBill t1      —出入库单据表
select * from ICStockBillentry t2 order by fitemid       —出入库单据分录表
select fclass,* from t_icitem v1 order by fnumber       —物料表
select * from t_organization          —客户表
select * from t_Supplier        —供应商
select * from t_Department c      —部门表
select * from ICBillType      —单据类型表
select * from v_ICTransType   —单据对应的单据ID
select * from t_measureunit e      —计量单位表
select * from t_submessage h   —辅助资料表
select * from t_ItemClass     —基础资料类别表
select * from T_itemdetail  —核算项目横表
select * from T_itemdetailv   —核算项目纵表
select * from t_SubMesType   —辅助资料类别表
select * from t_BaseProperty  —基础资料相关属性
select * from t_Item —基础资料主表
select * from ICtransactionType —单据的总体信息
select * from ICtableRelation —记录表间关系
select * from icbillno     —单据表
select * from AIS20110830111607..t_account —查询另外一个数据库的某个表的信息
select * from t_account  —科目表
SELECT * From t_RP_CheckInfo  —核销单据表
select * From t_checkproject  —表体信息
select * from t_systemprofile  —系统参数表
select * from icsale  —销售发票表
select * from icsaleentry  —销售发票明细表
select * from t_emp   —职员表
select * from t_pa_personal   —工资职员表
select * from ICPurchase  —购货发票表
select * from t_rp_potherbill —其他付款单
select * from T_RP_CheckInfo  —核销单据
select * from T_RP_CheckInfoEntry  —核销单据明细表
select * from ICHookRelations   —发票单据关系表
select * from icbal    —存货余额表
select * from ICInvBal   —库房存货余额表
select * from t_FieldDescription —万能报表字段描述表
select * from t_TableDescription order by FTablename—万能报表描述表
select * from t_ProfitAndLoss   —损益科目实际发生额
select * from t_systemprofile WHERE (FCategory = ‘gl’) AND (FKey = ‘Closed’)
select * from t_VoucherEntry  —凭证分录表
select * from t_Voucher where FChecked=0 and FPosted=1      —查询凭证:是否审核FChecked、是否过账FPosted

delete t_Voucher where fperiod=’1′ and fnumber=’7′  —删除第1期的7号凭证

select * from t_systemprofile
where FCategory=’GL’
and (FKey=’StartYear’ or FKey=’StartPeriod’) —查询总账的启用年度和启用期间

UPDATE t_SystemProfile SET FValue = 0 WHERE (FCategory = ‘gl’) AND (FKey = ‘Closed’) —(系统参数表)允许修改启用年度、期间、本位币、本位币小数点位数等

select b2.Ftablename 表名,b2.FDescription 中文表名,b1.FFieldname 字段名,
b1.FDescription 中文字段名,b1.ffieldnote 字段描述
from t_FieldDescription b1 inner join
t_TableDescription b2 on b1.FTableID=b2.FTableID
where b1.FDescription like ‘%年度%’   —根据字段名查询含有此字段的表

select b2.Ftablename 表名,b2.FDescription 中文表名,b1.FFieldname 字段名,
b1.FDescription 中文字段名,b1.ffieldnote 字段描述
from t_FieldDescription b1 inner join
t_TableDescription b2 on b1.FTableID=b2.FTableID
where b2.FDescription like ‘%凭证%’    —根据表名查询含此文字的表

select * from t_TableDescription where Fdescription like ‘%外购%’ —根据中文名称查询表

select b.fdescription,b.ftablename,a.ffieldname,a.fdescription
from t_FieldDescription a, t_TableDescription b
where a.ftableid=b.ftableid
and b.ftablename=’t_Voucher’   —根据表名查询表的字段

Select t1.Fdate,c.fnumber as fnumberc,c.fname as fnamec,v1.Fnumber as fnumberv1,v1.fname as fnamev1,e.fname as fjiliangdanwei,
t2.FQty,t2.fprice,t2.famount,t1.fbillno
from ICStockBill t1 inner join ICStockBillentry t2 on
t1.FInterID=t2.FInterID inner join  t_Item v1
on t2.Fitemid=v1.Fitemid inner join t_Department c on c.fitemid=t1.fdeptid
inner join t_measureunit e on e.fmeasureunitid=t2.funitid
Where t1.ftrantype=29
order by fnumberv1

Select * From t_Item Where FItemClassID=4

select * from t_itempropdesc
where fitemclassid=4     —核算项目类别ID
and Fname not like ‘*%’
and fname like ‘%科目%’   —修改此条的条件

select * from stemprofile where FCategory=’IC’ and FKey=’CurrentPeriod’
select * fom t_systemprofile where FCategory=’IC’ and FKey=’CurrentYear’
Select FStartDate,FEndDate From T_PeriodDate where FYear=@Year And FPeriod=@Per

发表回复