|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
数据库名: UFDATA_010_2022
D:\U8SOFT\Admin\SQLFILE16500\Main\Ufdata\Structure\data_vp_ne_u81650_nl.sql
错误信息:
-2147217900
对象名 'UFDATA_001_2022..FB_BgItem' 无效。
执行如下语句时出错:
CREATE PROCEDURE [dbo].[NE_GetExpenHead]
@VoucherId NVARCHAR(100)
AS
DECLARE @SumChar NVARCHAR(2048)
DECLARE @SumCostItemCode NVARCHAR(2048)
DECLARE @SumClassChar NVARCHAR(2048)
DECLARE @SumCostItemClassCode NVARCHAR(2048)
DECLARE @SumOverStandIOItemCode NVARCHAR(2048)
DECLARE @SumCharDep NVARCHAR(2048)
DECLARE @SumCharSpreadDep NVARCHAR(2048)
DECLARE @SumCharExpenser NVARCHAR(2048)
declare @LocalID nvarchar(20)
--汇总 行费用项目名称、编码、费用项目大类名称、大类编码、部门、费用承担部门、报销人
SET @SumChar = ''
SET @SumCostItemCode = ''
SET @SumClassChar = ''
SET @SumCostItemClassCode = ''
SET @SumCharDep = ''
SET @SumCharSpreadDep = ''
SET @SumCharExpenser = ''
SELECT @SumChar = @SumChar + N',' + ISNULL(ExpenseItem.cExpName, '') ,
@SumCostItemCode = @SumCostItemCode + N',' + ISNULL(ExpenseItem.cExpCode, '') ,
@SumClassChar = @SumClassChar + N',' + ISNULL(ExpItemClass.cExpCName, '') ,
@SumCostItemClassCode = @SumCostItemClassCode + N',' + ISNULL(ExpItemClass.cExpCCode, '') ,
@SumCharDep = @SumCharDep + N',' + ISNULL(Sub.DeptID, '') ,
@SumCharSpreadDep = @SumCharSpreadDep + N',' + ISNULL(Sub.SpreadDeptID, '') ,
@SumCharExpenser = @SumCharExpenser + N',' + ISNULL(Sub.ExpenserID, '')
FROM NE_ExpenseVouch_Sub Sub
LEFT JOIN ExpenseItem ON ExpenseItem.cExpCode = Sub.CostItemID
LEFT JOIN ExpItemClass on ExpenseItem.cExpCCode = ExpItemClass.cExpCCode
WHERE Sub.ExpenseVouchID = @VoucherId
--汇总 行费用项目,报销标准相关
SET @SumOverStandIOItemCode = ''
SELECT @SumOverStandIOItemCode = Sub.CostItemID + N','
+ @SumOverStandIOItemCode
FROM ( SELECT DISTINCT
Sub1.CostItemID
FROM NE_ExpenseVouch_Sub Sub1
WHERE Sub1.ExpenseVouchID = @VoucherId
AND Sub1.CostItemID IS NOT NULL
AND Sub1.CostItemID <> ''
AND ISNULL(Sub1.Quota, 0) > 0
AND ISNULL(Sub1.Quota, 0) * ISNULL(Sub1.Number, 1) < ISNULL(Sub1.ExpenseMoney, 0)
) Sub
set @LocalID = dbo.UDF_GetLocaleID()
--查询
SELECT CASE WHEN operationType.TypeID = '1' THEN 'NE02' ELSE 'NE03' END AS VoucherType,vouch.IsProxyVoucher,
vouch.Code AS VoucherCode ,vouch.ID as [GUID] ,vouch.AutoID ,
Cast(vouch.ts As money) AS ts ,operationType.Code as strTypeCode ,operationType.Name as strTypeName ,
vouch.ID as VoucherId,vouch.Code as strVouchID,vouch.ExpenseDate as dtLoanDate ,vouch.DeptID as strDepartID ,
vouch.SpreadDeptID as strSpreadDepartID,Department.cDepName as strDepart,SpreadDepartment.cDepName as strSpreadDepart ,
vouch.ExpenserID as strLoanID,Person.cPersonName as strLoan ,
vouch.ItemClassID as strItemClassID,fitem.citem_name as strItemClass,
vouch.ItemID as strItemID ,
items.citemname AS strItem ,
vouch.BudgetItemID as strBudItemID ,
bud.cItemName as strBudItem ,
vouch.Currency as strBill ,
vouch.ExchangeRate as fltRate ,
vouch.ExpenseMoney as dblMoney ,
vouch.LocalMoney as dblOldMoney ,
vouch.Used as strUsed ,
vouch.AgentID as strPersonID ,
vouch.Auditor as strAuditorID ,
vouch.MakerID as strMakerID ,
vouch.cDefine1 ,vouch.cDefine2 ,vouch.cDefine3 ,vouch.cDefine4 ,
vouch.cDefine5 ,vouch.cDefine6 ,vouch.cDefine7 ,vouch.cDefine8 ,
vouch.cDefine9 ,vouch.cDefine10 ,vouch.cDefine11 ,vouch.cDefine12 ,
vouch.cDefine13 ,vouch.cDefine14 ,vouch.cDefine15 ,vouch.cDefine16 ,
vouch.Port1 as strPort1,vouch.Port1Value as strPort1Value,
vouch.Port2 as strPort2,vouch.Port2Value as strPort2Value,
vouch.Port3 as strPort3,vouch.Port3Value as strPort3Value,vouch.Port4 as strPort4,
vouch.Port4Value as strPort4Value,vouch.Port5 as strPort5, vouch.Port5Value as strPort5Value,
vouch.Port6 as strPort6,vouch.Port6Value as strPort6Value,
vouch.Verifier as strVerifier ,
vouch.IsSettle as blnSettle ,
NE_AuditType.AuditName as blnAudi ,
NE_AuditType.LocaleID as LocaleID ,
vouch.OverBudgetAuditDesc as strOverDesc ,
vouch.OverBudgetAuditor as strOverPerson ,
convert(nvarchar(10),vouch.OverBudgetAuditDate,126) as strOverDate,
@SumChar AS strIOItems ,
@SumCostItemCode AS strIOItemCodes ,
@SumClassChar AS strIOItemClasss,
@SumCostItemClassCode as strIOItemCodeClasss,
@SumOverStandIOItemCode AS strOverStandIOItemCodes ,
vouch.CusCode as cCusCode ,
cus.ccusAbbname as cCusName,
vouch.VenCode as cVenCode ,
ven.cvenabbname as cVenName ,
@SumCharDep AS strSubDepartIds ,
@SumCharSpreadDep AS strSubSpreadDepartIds ,
@SumCharExpenser AS strSubLoanIds
,vouch.OverBudgetMoney,vouch.MaxRowVoucherMoney,vouch.SumRowVoucherMoney,vouch.IsOverBudget,vouch.IsOverBudgetAudit
FROM NE_ExpenVouch as vouch with (nolock)
inner join NE_OperationType as operationType with (nolock) ON vouch.OperationTypeCode = operationType.Code
left join NE_AuditType with (nolock) on vouch.IsAudit=NE_AuditType.AuditFlag and NE_AuditType.LocaleID=@LocalID
left join fitem with (nolock) ON vouch.ItemClassID = fitem.citem_class
left join Person with (nolock) ON vouch.ExpenserID = Person.cPersonCode
left join Department with (nolock) ON vouch.DeptID = Department.cDepCode
left join Department as SpreadDepartment with (nolock) ON vouch.SpreadDeptID = SpreadDepartment.cDepCode
left join BG_V_CtrlItem as bud with (nolock) ON vouch.BudgetItemID=bud.cItemCode
left join Customer as cus with (nolock) on vouch.CusCode=cus.cCusCode
left join Vendor as ven with (nolock) on vouch.VenCode=ven.cVenCode
LEFT JOIN vwNEfitemss as items with (nolock) ON vouch.ItemClassID = items.citem_class AND vouch.ItemID = items.citemcode
WHERE vouch.ID = @VoucherId
效率测试报告:开始升级UFDATA_010_2022数据库
data_str_wf_u81650_nl.SQL,2022-11-10 17:50:21 -- 2022-11-10 17:50:21,0小时0分钟0秒。
data_str_pb_u81650_nl.SQL,2022-11-10 17:50:21 -- 2022-11-10 17:50:21,0小时0分钟0秒。
data_str_wa_u81650_nl.SQL,2022-11-10 17:50:21 -- 2022-11-10 17:50:21,0小时0分钟0秒。
data_str_cm_u81650_nl.SQL,2022-11-10 17:50:21 -- 2022-11-10 17:50:22,0小时0分钟1秒。
data_str_ed_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_fa_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_ne_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_bg_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_ca_u81650_nl__up.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_ca_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_sc_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_sa_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_st_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_ia_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_pu_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:22,0小时0分钟0秒。
data_str_om_u81650_nl.SQL,2022-11-10 17:50:22 -- 2022-11-10 17:50:23,0小时0分钟1秒。
data_str_bs_u81650_nl.SQL,2022-11-10 17:50:23 -- 2022-11-10 17:50:23,0小时0分钟0秒。
data_str_fc_u81650_nl.SQL,2022-11-10 17:50:23 -- 2022-11-10 17:50:25,0小时0分钟2秒。
data_str_fb_u81650_nl.SQL,2022-11-10 17:50:25 -- 2022-11-10 17:50:25,0小时0分钟0秒。
data_str_ti_u81650_nl.SQL,2022-11-10 17:50:25 -- 2022-11-10 17:50:25,0小时0分钟0秒。
data_str_ba_u81650_nl.SQL,2022-11-10 17:50:25 -- 2022-11-10 17:50:25,0小时0分钟0秒。
data_str_uap_u81650_nl.SQL,2022-11-10 17:50:25 -- 2022-11-10 17:50:26,0小时0分钟1秒。
data_str_nenbs_u81650_nl.SQL,2022-11-10 17:50:26 -- 2022-11-10 17:50:26,0小时0分钟0秒。
data_str_glnbs_u81650_nl.SQL,2022-11-10 17:50:26 -- 2022-11-10 17:50:26,0小时0分钟0秒。
data_prv_cm_u81650_nl.SQL,2022-11-10 17:50:26 -- 2022-11-10 17:50:26,0小时0分钟0秒。
data_prv_pu_u81650_nl.SQL,2022-11-10 17:50:26 -- 2022-11-10 17:50:27,0小时0分钟1秒。
data_prv_om_u81650_nl.SQL,2022-11-10 17:50:27 -- 2022-11-10 17:50:27,0小时0分钟0秒。
data_vp_tm_u81650_nl.SQL,2022-11-10 17:50:27 -- 2022-11-10 17:50:27,0小时0分钟0秒。
data_vp_gl_u81650_nl.SQL,2022-11-10 17:50:27 -- 2022-11-10 17:50:27,0小时0分钟0秒。
data_vp_ca_u81650_nl.SQL,2022-11-10 17:50:27 -- 2022-11-10 17:50:28,0小时0分钟1秒。
data_vp_ap_u81650_nl.SQL,2022-11-10 17:50:28 -- 2022-11-10 17:50:28,0小时0分钟0秒。
data_vp_ec_u81650_nl.SQL,2022-11-10 17:50:28 -- 2022-11-10 17:50:29,0小时0分钟1秒。
data_vp_ed_u81650_nl.SQL,2022-11-10 17:50:29 -- 2022-11-10 17:50:29,0小时0分钟0秒。
data_vp_eq_u81650_nl.SQL,2022-11-10 17:50:29 -- 2022-11-10 17:50:29,0小时0分钟0秒。
data_vp_fa_u81650_nl.SQL,2022-11-10 17:50:29 -- 2022-11-10 17:50:29,0小时0分钟0秒。
升级起始时间:2022-11-10 17:50:21,结束时间:2022-11-10 17:50:30,0小时0分钟9秒。
|
|