|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
U8V16.1 固定资产1月份启用,结账提示BOF或EOF 无法结账
SELECT @@SPID
go
SELECT [session_name], [definition], [host_address], [owner_id], [table_name], [is_enabled] FROM [dbo].[pdw_diagnostics_sessions] (NOLOCK)
go
IF Exists( Select * FROM fa_Cards WHERE (((fa_Cards.dInputDate)<=N'2023-01-31') AND ((fa_Cards.dTransDate)<=N'2023-01-31' Or (fa_Cards.dTransDate) Is Null) AND ((fa_Cards.dDisposeDate)<=N'2023-01-31' Or (fa_Cards.dDisposeDate) Is Null)))
SELECT 1
Else
SELECT 0
go
set implicit_transactions on SET NO_BROWSETABLE OFF
go
Delete from UFFA_BAK_AccInformation where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_EQ_SendUser where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_AssetAttached where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_AssetTypes where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Depreciations where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Origins where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Status where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Items where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_ItemsManual where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_ItemsOfQuery where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_ItemsOfModel where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Models where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Cards where iyearJZ = 2023 and
imonthJZ = 1 Delete from UFFA_BAK_fa_DeptScale where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Cards_Detail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprTransactions_Detail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_WorkLoad_Detail where iyearJZ = 2023 and
imonthJZ = 1 Delete from UFFA_BAK_fa_Vouchers_Detail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_EvaluateVouchers_Detail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_CheckMain where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_CheckSetup where iyearJZ = 2023 and
imonthJZ = 1 Delete from UFFA_BAK_fa_CardsSheets where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Control where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprList where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprTransactions where iyearJZ = 2023 and imonthJZ = 1
Delete from UFFA_BAK_fa_DeprVoucherMain where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprVouchers where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprVouchers_pre where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Dictionary where iyearJZ = 2023 and imonthJZ = 1 Delete
from UFFA_BAK_fa_EvaluateMain where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_EvaluateVouchers where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_ZWVouchers where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Objects where iyearJZ = 2023 and imonthJZ = 1 Delete from
UFFA_BAK_fa_QueryFilters where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Querys where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Total where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Vouchers where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_WorkLoad where
iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_JKItemSet where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_JKSet where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_AssetGroup where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Vouchers_Group where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Vouchers_GroupDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_splitCards where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_checklists where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Cards_log where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_CardOfInv where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_CardOfPUColSet where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_SourceScale where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DepSourceSubject where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_SourceClass where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Source where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprTransactions_SourceDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Cards_SourceDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_WorkLoad_SourceDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_EvaluateVouchers_SourceDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_Vouchers_SourceDetail where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprVouchersSource_pre where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeprVouchersSource where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_DeptProScale where iyearJZ = 2023 and imonthJZ = 1 Delete from UFFA_BAK_fa_ApplyDeptProScale where iyearJZ = 2023 and imonthJZ = 1
go
INSERT INTO UFFA_BAK_AccInformation select cSysID, cID, cName, cCaption, cType, cValue, cDefault, bVisible, bEnable,1,2023 FROM AccInformation WHERE LOWER([cSysID]) = N'fa'
go
INSERT INTO UFFA_BAK_EQ_SendUser select cSendType, cPerson,1,2023 FROM EQ_SendUser where cSendType LIKE N'FA_%'
go
INSERT INTO UFFA_BAK_fa_AssetAttached select lID, sCardNum, sNum, sName, sStyle, sUnit, lQuantity, dblValue, dDate, memRemark, sMark, sLockedBy ,1,2023 FROM fa_AssetAttached
go
INSERT INTO UFFA_BAK_fa_AssetTypes(sID, sNum, sName, sEngName, sParentID, sParentNum, sNum1, sNum2, sNum3, sNum4, sDeprMethodNum, iDeprType, dblBVRate, sUnit, iLife, sModelID, iLevel, lByUsed, iDefineType, lChilds, bVisible, sLockedBy, sDefaultAssetSubjectNum, sDefaultDeprTotalSubjectNum, sDefaultDecPreSubjectNum, bNotCanRetDecValue, sNum5, sNum6, sNum7, sNum8, sDefaultCleanUpSubjectNum, bNewAssetDepr,sDefaultDeprSubjectByType,imonthjz,iyearjz) select sID, sNum, sName, sEngName, sParentID, sParentNum, sNum1, sNum2, sNum3, sNum4, sDeprMethodNum, iDeprType, dblBVRate, sUnit, iLife, sModelID, iLevel, lByUsed, iDefineType, lChilds, bVisible, sLockedBy, sDefaultAssetSubjectNum, sDefaultDeprTotalSubjectNum, sDefaultDecPreSubjectNum, bNotCanRetDecValue, sNum5, sNum6, sNum7, sNum8, sDefaultCleanUpSubjectNum, bNewAssetDepr,sDefaultDeprSubjectByType,1,2023 FROM fa_AssetTypes
go
INSERT INTO UFFA_BAK_fa_Depreciations select * ,1,2023 FROM fa_Depreciations
go
INSERT INTO UFFA_BAK_fa_Origins select * ,1,2023 FROM fa_Origins
go
INSERT INTO UFFA_BAK_fa_Status select * ,1,2023 FROM fa_Status
go
INSERT INTO UFFA_BAK_fa_Items select * ,1,2023 FROM fa_Items
go
SET NO_BROWSETABLE ON
go
select A.Name as columname,A.length as length,CASE A.xtype WHEN N'61' THEN N'' WHEN N'62' THEN N'' when N'56' then N'' WHEN N'231' THEN N'(' + CONVERT(char(3), A.length) + N')' END as clength,CASE A.xtype WHEN N'61' THEN N'datetime' WHEN N'62' THEN N'float' when N'56' then N'int' WHEN N'231' THEN N'nvarchar' END AS type from syscolumns A inner join sysobjects B on A.id = B.id where objectProperty(B.id,N'IsUserTable') = 1 and a.Name like N'man%' and B.id = object_id(N'fa_ItemsManual')
go
SET NO_BROWSETABLE OFF
go
delete UFFA_BAK_fa_ItemsManual where imonthJZ = 1 and iyearJZ = 2023 INSERT INTO UFFA_BAK_fa_ItemsManual(sCardNum,imonthJZ,iyearJZ) select sCardNum,1,2023 from fa_ItemsManual
go
INSERT INTO UFFA_BAK_fa_CheckMain select [sNum], [dCheckDate], [iCheckMode], [sCheckRange], [sOperator] ,1,2023,sCheckNums,[sSummaryNum],[Summarized] FROM fa_CheckMain
go
INSERT INTO UFFA_BAK_fa_CheckSetup select [sCheckNum], [bSetType],[sItemNum] ,1,2023 FROM fa_CheckSetup
go
INSERT INTO UFFA_BAK_fa_checklists select sCheckNum,sAssetNum,sAssetName,iStatus,iSign,sRemark,sTypeNum,dStartdate,sAssetNumNew,cApprover ,1,2023,Summarized FROM fa_checklists
go
SET NO_BROWSETABLE ON
go
select A.Name as columname,A.length as length,CASE A.xtype WHEN N'61' THEN N'' WHEN N'62' THEN N'' when N'56' then N'' WHEN N'231' THEN N'(' + CONVERT(char(3), A.length) + N')' END as clength,CASE A.xtype WHEN N'61' THEN N'datetime' WHEN N'62' THEN N'float' when N'56' then N'int' WHEN N'231' THEN N'nvarchar' END AS type from syscolumns A inner join sysobjects B on A.id = B.id where objectProperty(B.id,N'IsUserTable') = 1 and a.Name like N'man%' and B.id = object_id(N'fa_CheckData')
go
SET NO_BROWSETABLE OFF
go
delete UFFA_BAK_fa_CheckData where imonthJZ = 1 and iyearJZ = 2023 INSERT INTO UFFA_BAK_fa_CheckData(sCheckNum, sAssetNum, sAssetName, sDeptNum, sTypeNum, sCurrency, sStyle, sSite, lLife, dStartdate, dInputDate, dblFCValue, dblExchangeRate, sOperator, dblValue, dblBV, dblBVRate, dblCanWork, dblPerDepr, sWorkUnit, sTypeName, sOrgAdd, sStatus, sDeprMethod, lDeprMonths, dblWork, dblWorkT, dblDeprRate, dblDepr, dblDeprT, dblNetValue, dblBuildArea, lBuildNum, lMachinNum, dblMachinW, dblDecPreValueT, dblRetDecPreValueT, sDeptNames, bMultiDept, sGroupNum,sKeeper ,cVenCode,dPurDate,sSummaryNum ,imonthJZ,iyearJZ) select sCheckNum, sAssetNum, sAssetName, sDeptNum, sTypeNum, sCurrency, sStyle, sSite, lLife, dStartdate, dInputDate, dblFCValue, dblExchangeRate, sOperator, dblValue, dblBV, dblBVRate, dblCanWork, dblPerDepr, sWorkUnit, sTypeName, sOrgAdd, sStatus, sDeprMethod, lDeprMonths, dblWork, dblWorkT, dblDeprRate, dblDepr, dblDeprT, dblNetValue, dblBuildArea, lBuildNum, lMachinNum, dblMachinW, dblDecPreValueT, dblRetDecPreValueT, sDeptNames, bMultiDept, sGroupNum,sKeeper ,cVenCode,dPurDate,sSummaryNum ,1,2023 from fa_CheckData
go
INSERT INTO UFFA_BAK_fa_ItemsOfQuery select iQuerysType,sName,1,2023 FROM fa_ItemsOfQuery
go
INSERT INTO UFFA_BAK_fa_ItemsOfModel select sModelID, iSheetID, sItemID, lItemRow, lItemStartCol, lItemEndCol, lInputCol, bSameCaption, sLockedBy ,2023,1 ,2023 FROM fa_ItemsOfModel where iyear = 2023
go
INSERT INTO UFFA_BAK_fa_Models select *,1,2023 FROM fa_Models
go
INSERT INTO UFFA_BAK_fa_Cards(sCardID,sCardNum,sAssetNum,sAssetName,lOptID,iOptType,iNewType,sZWVoucherType,sZWVoucherNum,sDeptNum,sTypeNum,sOrgID,sOrgAddID,sOrgDisposeID,sDisposeReason,sStatusID,sDeprMethodID,sCurrency,sDeprSubjectNum,sDeprSubjectName,sProjectNum,sProjectName,sStyle,dblBuildArea,lBuildNum,lMachinNum,dblMachinW,sSite,lLife,dStartdate,dInputDate,dTransDate,dDisposeDate,iInputPeriod,iTransPeriod,iDisposePeriod,dblFCValue,dblExchangeRate,sOperator,sDisposer,dblNetValueAct,lDeprMonthsAct,dblCanWorkAct,dblLegacy,sVoucherNum,sEvaluateNum,dblValue,dblDecDeprT,dblDecDepr,dblDecDeprRate,lDecDeprMonths,dblDecWorkT,dblDecPerDepr,dblBV, dblBVRate,dblCanWork,dblPerDepr,lUsedMonths,sWorkUnit, dblTransInDeprTCard, dblTransOutDeprTCard,iVouchsNextMonthAct,sTransTypeNum,sTransDepteNum, sLockedBy, dblDecPreValueT,dblRetDecPreValueT, bMultiDept,sDeptNames,bNewDepring,sGroupNum,bSplit,dblAddTax,dblValueAndTax,bFromInv,sKeeper,cVenCode,dPurDate,sSeriesNum,sCommodityCode,imonthJZ,iyearJZ) select sCardID,sCardNum,sAssetNum,sAssetName,lOptID,iOptType,iNewType,sZWVoucherType,sZWVoucherNum, sDeptNum,sTypeNum,sOrgID,sOrgAddID,sOrgDisposeID,sDisposeReason,sStatusID,sDeprMethodID,sCurrency,sDeprSubjectNum,sDeprSubjectName,sProjectNum,sProjectName,sStyle,dblBuildArea,lBuildNum,lMachinNum,dblMachinW,sSite,lLife,dStartdate,dInputDate,dTransDate,dDisposeDate,iInputPeriod,iTransPeriod,iDisposePeriod,dblFCValue,dblExchangeRate,sOperator,sDisposer,dblNetValueAct,lDeprMonthsAct,dblCanWorkAct,dblLegacy,sVoucherNum,sEvaluateNum,dblValue,dblDecDeprT,dblDecDepr,dblDecDeprRate,lDecDeprMonths,dblDecWorkT,dblDecPerDepr,dblBV,dblBVRate,dblCanWork,dblPerDepr,lUsedMonths,sWorkUnit, dblTransInDeprTCard, dblTransOutDeprTCard,iVouchsNextMonthAct, sTransTypeNum, sTransDepteNum, sLockedBy,dblDecPreValueT,dblRetDecPreValueT,bMultiDept,sDeptNames,bNewDepring,sGroupNum,bSplit,dblAddTax,dblValueAndTax,bFromInv,sKeeper,cVenCode,dPurDate,sSeriesNum,sCommodityCode,1,N'2023' FROM fa_Cards
go
INSERT INTO UFFA_BAK_fa_Cards_log select VariationAction, VariationLogId, bDeletedRst, dLogTime, sCardID, sCardNum, sAssetNum, sAssetName, lOptID, iOptType, iNewType, sZWVoucherType, sZWVoucherNum, sDeptNum, sTypeNum, sOrgID, sOrgAddID, sOrgDisposeID, sDisposeReason, sStatusID,sDeprMethodID, sCurrency, sDeprSubjectNum, sDeprSubjectName, sProjectNum, sProjectName, sStyle, dblBuildArea, lBuildNum, lMachinNum, dblMachinW, sSite, lLife, dStartdate, dInputDate, dTransDate, dDisposeDate, iInputPeriod, iTransPeriod, iDisposePeriod, dblFCValue, dblExchangeRate, sOperator, sDisposer, dblNetValueAct, lDeprMonthsAct,dblCanWorkAct, dblLegacy, sVoucherNum, sEvaluateNum, dblValue, dblDecDeprT, dblDecDepr, dblDecDeprRate, lDecDeprMonths, dblDecWorkT, dblDecPerDepr, dblBV, dblBVRate, dblCanWork, dblPerDepr, lUsedMonths, sWorkUnit, dblTransInDeprTCard, dblTransOutDeprTCard, iVouchsNextMonthAct, sTransTypeNum, sTransDepteNum, sLockedBy, dblDecPreValueT,dblRetDecPreValueT, bMultiDept, sDeptNames, bNewDepring, sGroupNum, bSplit, dblAddTax, dblValueAndTax, bFromInv,sKeeper ,1,2023 , cVenCode,dPurDate , sSeriesNum,sCommodityCode FROM fa_Cards_log
go
INSERT INTO UFFA_BAK_fa_splitCards select sSplitNum, lOptID, sCardNum, iSplitCount, sVoucherNum, bParent, bDelete,1,2023 FROM fa_splitCards
go
INSERT INTO UFFA_BAK_fa_CardOfInv select *,1,2023 FROM fa_CardOfInv
go
INSERT INTO UFFA_BAK_fa_CardOfPUColSet select *,1,2023 FROM fa_CardOfPUColSet
go
INSERT INTO UFFA_BAK_fa_AssetGroup select *,1,2023 FROM fa_AssetGroup
go
INSERT INTO UFFA_BAK_fa_Vouchers_Group select *,1,2023 FROM fa_Vouchers_Group
go
INSERT INTO UFFA_BAK_fa_Vouchers_GroupDetail select *,1,2023 FROM fa_Vouchers_GroupDetail
go
INSERT INTO UFFA_BAK_fa_DeptScale select *,1,2023 FROM fa_DeptScale
go
INSERT INTO UFFA_BAK_fa_DeptProScale(sCardNum, sDeptNum, lOptID, dblScale, sDeprSubjectnum, sDeprSubjectName, sProjectNum, sProjectName, cItemclsId,imonthJZ,iyearJZ) select sCardNum,sDeptNum,lOptID,dblScale,sDeprSubjectNum,sDeprSubjectName,sProjectNum,sProjectName,cItemclsId ,1,2023 FROM fa_DeptProScale
go
INSERT INTO UFFA_BAK_fa_ApplyDeptProScale(vchID,sCardNum, sDeptNum, dblScale, sDeprSubjectnum, sDeprSubjectName, sProjectNum, sProjectName, cItemclsId,imonthJZ,iyearJZ) select vchID, sCardNum,sDeptNum,dblScale,sDeprSubjectNum,sDeprSubjectName,sProjectNum,sProjectName,cItemclsId ,1,2023 FROM fa_ApplyDeptProScale
go
INSERT INTO UFFA_BAK_fa_Cards_Detail select sCardID, sCardNum, sDeptNum, lOptID, dDisposeDate, iDisposePeriod, dblValue, dblDecDeprT, dblBV, dblCanWork, dblTransInDeprTCard, dblTransOutDeprTCard, dblDecPreValueT, dblRetDecPreValueT, dblBuildArea, lBuildNum, lMachinNum, dblMachinW, dblAddtax,dblValueAndTax ,1,2023 FROM fa_Cards_Detail
go
INSERT INTO UFFA_BAK_fa_DeprTransactions_Detail select sCardNum, sDeptNum, dblDepr1, dblDeprT1, dblDepr2, dblDeprT2, dblDepr3, dblDeprT3, dblDepr4, dblDeprT4, dblDepr5, dblDeprT5, dblDepr6, dblDeprT6, dblDepr7, dblDeprT7, dblDepr8, dblDeprT8, dblDepr9, dblDeprT9, dblDepr10, dblDeprT10, dblDepr11, dblDeprT11, dblDepr12, dblDeprT12, dblMonthValue1, dblMonthValue2, dblMonthValue3, dblMonthValue4, dblMonthValue5, dblMonthValue6, dblMonthValue7, dblMonthValue8, dblMonthValue9, dblMonthValue10, dblMonthValue11, dblMonthValue12, dblMonthValue13, dblDeprThisYear,iyear,1,2023 FROM fa_DeprTransactions_Detail where iyear = 2023
go
INSERT INTO UFFA_BAK_fa_WorkLoad_Detail select sCardNum, sDeptNum, dblWork1, dblWorkT1, dblWork2, dblWorkT2, dblWork3, dblWorkT3, dblWork4, dblWorkT4, dblWork5, dblWorkT5, dblWork6, dblWorkT6, dblWork7, dblWorkT7, dblWork8, dblWorkT8, dblWork9, dblWorkT9, dblWork10, dblWorkT10, dblWork11, dblWorkT11, dblWork12, dblWorkT12, dblDeprWorkThisYear,iyear ,1,2023 FROM fa_WorkLoad_Detail where iyear = 2023
go
INSERT INTO UFFA_BAK_fa_Vouchers_Detail(sNum, lOptID, sCardNum, sDeptNum, sBeforeVoucher, sAfterVoucher,sItemID, sSiteAfter ,sKeeperAfter,imonthJZ,iyearJZ,dblAddValueVou) select sNum, lOptID, sCardNum, sDeptNum, sBeforeVoucher, sAfterVoucher,sItemID, sSiteAfter ,sKeeperAfter,1,2023 ,dblAddValueVou FROM fa_Vouchers_Detail
go
|
|