|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
CREATE TRIGGER insertinventory2 ON dbo.inventory
FOR INSERT
AS
Declare @cInvCode nvarchar(20)
Declare @cInvAddCode nvarchar(30)
Declare @cInvName nvarchar(60)
Declare @cInvStd nvarchar(60)
Declare @cInvCCode nvarchar(12)
Declare @cVenCode nvarchar(20)
Declare @cReplaceItem nvarchar(20)
Declare @cPosition nvarchar(20)
Declare @bSale bit
Declare @bPurchase bit
Declare @bSelf bit
Declare @bComsume bit
Declare @bProducing bit
Declare @bService bit
Declare @bAccessary bit
Declare @iTaxRate float
Declare @iInvWeight float
Declare @iVolume float
Declare @iInvRCost float
Declare @iInvSPrice float
Declare @iInvSCost float
Declare @iInvLSCost float
Declare @iInvNCost float
Declare @iInvAdvance float
Declare @iInvBatch float
Declare @iSafeNum float
Declare @iTopSum float
Declare @iLowSum float
Declare @iOverStock float
Declare @cInvABC nvarchar(1)
Declare @bInvQuality bit
Declare @bInvBatch bit
Declare @bInvEntrust bit
Declare @bInvOverStock bit
Declare @dSDate datetime
Declare @dEDate datetime
Declare @bFree1 bit
Declare @bFree2 bit
Declare @cInvDefine1 nvarchar(20)
Declare @cInvDefine2 nvarchar(20)
Declare @cInvDefine3 nvarchar(20)
Declare @bInvType bit
Declare @iInvMPCost float
Declare @cQuality nvarchar(100)
Declare @iInvSaleCost float
Declare @iInvSCost1 float
Declare @iInvSCost2 float
Declare @iInvSCost3 float
Declare @bFree3 bit
Declare @bFree4 bit
Declare @bFree5 bit
Declare @bFree6 bit
Declare @bFree7 bit
Declare @bFree8 bit
Declare @bFree9 bit
Declare @bFree10 bit
Declare @cCreatePerson nvarchar(20)
Declare @cModifyPerson nvarchar(20)
Declare @dModifyDate datetime
Declare @fSubscribePoint float
Declare @fVagQuantity float
Declare @cValueType nvarchar(20)
Declare @bFixExch bit
Declare @fOutExcess float
Declare @fInExcess float
Declare @iMassDate smallint
Declare @iWarnDays smallint
Declare @fExpensesExch float
Declare @bTrack bit
Declare @bSerial bit
Declare @bBarCode bit
Declare @cBarCode nvarchar(30)
Declare @cInvDefine4 nvarchar(60)
Declare @cInvDefine5 nvarchar(60)
Declare @cInvDefine6 nvarchar(60)
Declare @cInvDefine7 nvarchar(120)
Declare @cInvDefine8 nvarchar(120)
Declare @cInvDefine9 nvarchar(120)
Declare @cInvDefine10 nvarchar(120)
Declare @cInvDefine11 int
Declare @cInvDefine12 int
Declare @cInvDefine13 float
Declare @cInvDefine14 float
Declare @cInvDefine15 datetime
Declare @cInvDefine16 datetime
Declare @iGroupType tinyint
Declare @cGroupCode nvarchar(35)
Declare @cComUnitCode nvarchar(35)
Declare @cAssComUnitCode nvarchar(35)
Declare @cSAComUnitCode nvarchar(35)
Declare @cPUComUnitCode nvarchar(35)
Declare @cSTComUnitCode nvarchar(35)
Declare @cCAComUnitCode nvarchar(35)
Declare @cFrequency nvarchar(10)
Declare @iFrequency smallint
Declare @iDays smallint
Declare @dLastDate datetime
Declare @iWastage float
Declare @bSolitude bit
Declare @cEnterprise nvarchar(100)
Declare @cAddress nvarchar(255)
Declare @cFile nvarchar(40)
Declare @cLabel nvarchar(30)
Declare @cCheckOut nvarchar(30)
Declare @cLicence nvarchar(30)
Declare @bSpecialties bit
Declare @cDefWareHouse nvarchar(10)
Declare @iHighPrice float
Declare @iExpSaleRate float
Declare @cPriceGroup nvarchar(20)
Declare @cOfferGrade nvarchar(20)
Declare @iOfferRate float
Declare @cMonth nvarchar(6)
Declare @iAdvanceDate smallint
Declare @cCurrencyName nvarchar(60)
Declare @cProduceAddress nvarchar(255)
Declare @cProduceNation nvarchar(60)
Declare @cRegisterNo nvarchar(60)
Declare @cEnterNo nvarchar(60)
Declare @cPackingType nvarchar(60)
Declare @cEnglishName nvarchar(100)
Declare @bPropertyCheck bit
Declare @cPreparationType nvarchar(30)
Declare @cCommodity nvarchar(60)
Declare @iRecipeBatch tinyint
Declare @cNotPatentName nvarchar(30)
Declare @bPromotSales bit
Declare @iPlanPolicy smallint
Declare @iROPMethod smallint
Declare @iBatchRule smallint
Declare @fBatchIncrement float
Declare @iAssureProvideDays int
Declare @iTestStyle smallint
Declare @iDTMethod smallint
Declare @fDTRate float
Declare @fDTNum float
Declare @cDTUnit nvarchar(35)
Declare @iDTStyle smallint
Declare @iQTMethod int
Declare @PictureGUID uniqueidentifier
Declare @bPlanInv bit
Declare @bProxyForeign bit
Declare @bATOModel bit
Declare @bCheckItem bit
Declare @bPTOModel bit
Declare @bEquipment bit
Declare @cProductUnit nvarchar(35)
Declare @fOrderUpLimit float
Declare @cMassUnit smallint
Declare @fRetailPrice float
Declare @cInvDepCode nvarchar(12)
Declare @iAlterAdvance int
Declare @fAlterBaseNum float
Declare @cPlanMethod nvarchar(1)
Declare @bMPS bit
Declare @bROP bit
Declare @bRePlan bit
Declare @cSRPolicy nvarchar(2)
Declare @bBillUnite bit
Declare @iSupplyDay int
Declare @fSupplyMulti float
Declare @fMinSupply float
Declare @bCutMantissa bit
Declare @cInvPersonCode nvarchar(20)
Declare @iInvTfId int
Declare @cEngineerFigNo nvarchar(60)
Declare @bInTotalCost bit
Declare @iSupplyType smallint
Declare @bConfigFree1 bit
Declare @bConfigFree2 bit
Declare @bConfigFree3 bit
Declare @bConfigFree4 bit
Declare @bConfigFree5 bit
Declare @bConfigFree6 bit
Declare @bConfigFree7 bit
Declare @bConfigFree8 bit
Declare @bConfigFree9 bit
Declare @bConfigFree10 bit
Declare @iDTLevel smallint
Declare @cDTAQL nvarchar(20)
Declare @bPeriodDT bit
Declare @cDTPeriod nvarchar(30)
Declare @iBigMonth int
Declare @iBigDay int
Declare @iSmallMonth int
Declare @iSmallDay int
Declare @bOutInvDT bit
Declare @bBackInvDT bit
Declare @iEndDTStyle smallint
Declare @bDTWarnInv bit
Declare @fBackTaxRate float
Declare @cCIQCode nvarchar(30)
Declare @cWGroupCode nvarchar(35)
Declare @cWUnit nvarchar(35)
Declare @fGrossW float
Declare @cVGroupCode nvarchar(35)
Declare @cVUnit nvarchar(35)
Declare @fLength float
Declare @fWidth float
Declare @fHeight float
Declare @iDTUCounter int
Declare @iDTDCounter int
Declare @iBatchCounter int
Declare @cShopUnit nvarchar(35)
Declare @cPurPersonCode nvarchar(20)
Declare @bImportMedicine bit
Declare @bFirstBusiMedicine bit
Declare @bForeExpland bit
Declare @cInvPlanCode nvarchar(20)
Declare @fConvertRate float
Declare @dReplaceDate datetime
Declare @bInvModel bit
Declare @bKCCutMantissa bit
Declare @bReceiptByDT bit
Declare @iImpTaxRate float
Declare @iExpTaxRate float
Declare @bExpSale bit
Declare @iDrawBatch int
Declare @bCheckBSATP bit
Declare @cInvProjectCode nvarchar(16)
Declare @iTestRule smallint
Declare @cRuleCode nvarchar(20)
Declare @bCheckFree1 bit
Declare @bCheckFree2 bit
Declare @bCheckFree3 bit
Declare @bCheckFree4 bit
Declare @bCheckFree5 bit
Declare @bCheckFree6 bit
Declare @bCheckFree7 bit
Declare @bCheckFree8 bit
Declare @bCheckFree9 bit
Declare @bCheckFree10 bit
Declare @bBomMain bit
Declare @bBomSub bit
Declare @bProductBill bit
Declare @iCheckATP smallint
Declare @iInvATPId int
Declare @iPlanTfDay int
Declare @iOverlapDay int
Declare @bPiece bit
Declare @bSrvItem bit
Declare @bSrvFittings bit
Declare @fMaxSupply float
Declare @fMinSplit float
Declare @bSpecialOrder bit
Declare @bTrackSaleBill bit
set @cinvcode =(select cinvcode from inserted)
if not exists(select cinvcode from UFDATA_901_2012.dbo.inventory where cinvcode = @cinvcode)
begin
insert UFDATA_901_2012.dbo.inventory (cInvCode,cInvAddCode,cInvName,cInvStd,cInvCCode,cVenCode,cReplaceItem,cPosition,bSale,bPurchase,bSelf,bComsume,bProducing,bService,bAccessary,iTaxRate,iInvWeight,iVolume,iInvRCost,iInvSPrice,iInvSCost,iInvLSCost,iInvNCost,iInvAdvance,iInvBatch,iSafeNum,iTopSum,iLowSum,iOverStock,cInvABC,bInvQuality,bInvBatch,bInvEntrust,bInvOverStock,dSDate,dEDate,bFree1,bFree2,cInvDefine1,cInvDefine2,cInvDefine3,bInvType,iInvMPCost,cQuality,iInvSaleCost,iInvSCost1,iInvSCost2,iInvSCost3,bFree3,bFree4,bFree5,bFree6,bFree7,bFree8,bFree9,bFree10,cCreatePerson,cModifyPerson,dModifyDate,fSubscribePoint,fVagQuantity,cValueType,bFixExch,fOutExcess,fInExcess,iMassDate,iWarnDays,fExpensesExch,bTrack,bSerial,bBarCode,iId,cBarCode,cInvDefine4,cInvDefine5,cInvDefine6,cInvDefine7,cInvDefine8,cInvDefine9,cInvDefine10,cInvDefine11,cInvDefine12,cInvDefine13,cInvDefine14,cInvDefine15,cInvDefine16,iGroupType,cGroupCode,cComUnitCode,cAssComUnitCode,cSAComUnitCode,cPUComUnitCode,cSTComUnitCode,cCAComUnitCode,cFrequency,iFrequency,iDays,dLastDate,iWastage,bSolitude,cEnterprise,cAddress,cFile,cLabel,cCheckOut,cLicence,bSpecialties,cDefWareHouse,iHighPrice,iExpSaleRate,cPriceGroup,cOfferGrade,iOfferRate,cMonth,iAdvanceDate,cCurrencyName,cProduceAddress,cProduceNation,cRegisterNo,cEnterNo,cPackingType,cEnglishName,bPropertyCheck,cPreparationType,cCommodity,iRecipeBatch,cNotPatentName,bPromotSales,iPlanPolicy,iROPMethod,iBatchRule,fBatchIncrement,iAssureProvideDays,iTestStyle,iDTMethod,fDTRate,fDTNum,cDTUnit,iDTStyle,iQTMethod,PictureGUID,bPlanInv,bProxyForeign,bATOModel,bCheckItem,bPTOModel,bEquipment,cProductUnit,fOrderUpLimit,cMassUnit,fRetailPrice,cInvDepCode,iAlterAdvance,fAlterBaseNum,cPlanMethod,bMPS,bROP,bRePlan,cSRPolicy,bBillUnite,iSupplyDay,fSupplyMulti,fMinSupply,bCutMantissa,cInvPersonCode,iInvTfId,cEngineerFigNo,bInTotalCost,iSupplyType,bConfigFree1,bConfigFree2,bConfigFree3,bConfigFree4,bConfigFree5,bConfigFree6,bConfigFree7,bConfigFree8,bConfigFree9,bConfigFree10,iDTLevel,cDTAQL,bPeriodDT,cDTPeriod,iBigMonth,iBigDay,iSmallMonth,iSmallDay,bOutInvDT,bBackInvDT,iEndDTStyle,bDTWarnInv,fBackTaxRate,cCIQCode,cWGroupCode,cWUnit,fGrossW,cVGroupCode,cVUnit,fLength,fWidth,fHeight,iDTUCounter,iDTDCounter,iBatchCounter,cShopUnit,cPurPersonCode,bImportMedicine,bFirstBusiMedicine,bForeExpland,cInvPlanCode,fConvertRate,dReplaceDate,bInvModel,bKCCutMantissa,bReceiptByDT,iImpTaxRate,iExpTaxRate,bExpSale,iDrawBatch,bCheckBSATP,cInvProjectCode,iTestRule,cRuleCode,bCheckFree1,bCheckFree2,bCheckFree3,bCheckFree4,bCheckFree5,bCheckFree6,bCheckFree7,bCheckFree8,bCheckFree9,bCheckFree10,bBomMain,bBomSub,bProductBill,iCheckATP,iInvATPId,iPlanTfDay,iOverlapDay,bPiece,bSrvItem,bSrvFittings,fMaxSupply,fMinSplit,bSpecialOrder,bTrackSaleBill) select cInvCode,cInvAddCode,cInvName,cInvStd,cInvCCode,cVenCode,cReplaceItem,cPosition,bSale,bPurchase,bSelf,bComsume,bProducing,bService,bAccessary,iTaxRate,iInvWeight,iVolume,iInvRCost,iInvSPrice,iInvSCost,iInvLSCost,iInvNCost,iInvAdvance,iInvBatch,iSafeNum,iTopSum,iLowSum,iOverStock,cInvABC,bInvQuality,bInvBatch,bInvEntrust,bInvOverStock,dSDate,dEDate,bFree1,bFree2,cInvDefine1,cInvDefine2,cInvDefine3,bInvType,iInvMPCost,cQuality,iInvSaleCost,iInvSCost1,iInvSCost2,iInvSCost3,bFree3,bFree4,bFree5,bFree6,bFree7,bFree8,bFree9,bFree10,cCreatePerson,cModifyPerson,dModifyDate,fSubscribePoint,fVagQuantity,cValueType,bFixExch,fOutExcess,fInExcess,iMassDate,iWarnDays,fExpensesExch,bTrack,bSerial,bBarCode,iId,cBarCode,cInvDefine4,cInvDefine5,cInvDefine6,cInvDefine7,cInvDefine8,cInvDefine9,cInvDefine10,cInvDefine11,cInvDefine12,cInvDefine13,cInvDefine14,cInvDefine15,cInvDefine16,iGroupType,cGroupCode,cComUnitCode,cAssComUnitCode,cSAComUnitCode,cPUComUnitCode,cSTComUnitCode,cCAComUnitCode,cFrequency,iFrequency,iDays,dLastDate,iWastage,bSolitude,cEnterprise,cAddress,cFile,cLabel,cCheckOut,cLicence,bSpecialties,cDefWareHouse,iHighPrice,iExpSaleRate,cPriceGroup,cOfferGrade,iOfferRate,cMonth,iAdvanceDate,cCurrencyName,cProduceAddress,cProduceNation,cRegisterNo,cEnterNo,cPackingType,cEnglishName,bPropertyCheck,cPreparationType,cCommodity,iRecipeBatch,cNotPatentName,bPromotSales,iPlanPolicy,iROPMethod,iBatchRule,fBatchIncrement,iAssureProvideDays,iTestStyle,iDTMethod,fDTRate,fDTNum,cDTUnit,iDTStyle,iQTMethod,PictureGUID,bPlanInv,bProxyForeign,bATOModel,bCheckItem,bPTOModel,bEquipment,cProductUnit,fOrderUpLimit,cMassUnit,fRetailPrice,cInvDepCode,iAlterAdvance,fAlterBaseNum,cPlanMethod,bMPS,bROP,bRePlan,cSRPolicy,bBillUnite,iSupplyDay,fSupplyMulti,fMinSupply,bCutMantissa,cInvPersonCode,iInvTfId,cEngineerFigNo,bInTotalCost,iSupplyType,bConfigFree1,bConfigFree2,bConfigFree3,bConfigFree4,bConfigFree5,bConfigFree6,bConfigFree7,bConfigFree8,bConfigFree9,bConfigFree10,iDTLevel,cDTAQL,bPeriodDT,cDTPeriod,iBigMonth,iBigDay,iSmallMonth,iSmallDay,bOutInvDT,bBackInvDT,iEndDTStyle,bDTWarnInv,fBackTaxRate,cCIQCode,cWGroupCode,cWUnit,fGrossW,cVGroupCode,cVUnit,fLength,fWidth,fHeight,iDTUCounter,iDTDCounter,iBatchCounter,cShopUnit,cPurPersonCode,bImportMedicine,bFirstBusiMedicine,bForeExpland,cInvPlanCode,fConvertRate,dReplaceDate,bInvModel,bKCCutMantissa,bReceiptByDT,iImpTaxRate,iExpTaxRate,bExpSale,iDrawBatch,bCheckBSATP,cInvProjectCode,iTestRule,cRuleCode,bCheckFree1,bCheckFree2,bCheckFree3,bCheckFree4,bCheckFree5,bCheckFree6,bCheckFree7,bCheckFree8,bCheckFree9,bCheckFree10,bBomMain,bBomSub,bProductBill,iCheckATP,iInvATPId,iPlanTfDay,iOverlapDay,bPiece,bSrvItem,bSrvFittings,fMaxSupply,fMinSplit,bSpecialOrder,bTrackSaleBill from inserted
End
|
|