金蝶实施服务常用sql语句
— 在所有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
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
delete t_Voucher where fperiod=’1′ and fnumber=’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
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
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