(@0 decimal(17,3),@1 decimal(17,3),@2 uniqueidentifier)update [Erp].[OrderHed]
set [TotalTax] = @0, [DocTotalTax] = @1
where ([SysRowID] = @2)
select [SysRevID]
from [Erp].[OrderHed]
where @@ROWCOUNT > 0 and [SysRowID] = @2
.
(@p__linq__0 uniqueidentifier)SELECT TOP (1)
[Extent2].[OpenOrder] AS [OpenOrder],
[Extent2].[VoidOrder] AS [VoidOrder],
[Extent2].[Company] AS [Company],
[Extent2].[OrderNum] AS [OrderNum],
[Extent2].[CustNum] AS [CustNum],
[Extent2].[PONum] AS [PONum],
[Extent2].[OrderHeld] AS [OrderHeld],
[Extent2].[EntryPerson] AS [EntryPerson],
[Extent2].[ShipToNum] AS [ShipToNum],
[Extent2].[RequestDate] AS [RequestDate],
[Extent2].[OrderDate] AS [OrderDate],
[Extent2].[FOB] AS [FOB],
[Extent2].[ShipViaCode] AS [ShipViaCode],
[Extent2].[TermsCode] AS [TermsCode],
[Extent2].[DiscountPercent] AS [DiscountPercent],
[Extent2].[PrcConNum] AS [PrcConNum],
[Extent2].[ShpConNum] AS [ShpConNum],
[Extent2].[SalesRepList] AS [SalesRepList],
[Extent2].[OrderComment] AS [OrderComment],
[Extent2].[ShipComment] AS [ShipComment],
[Extent2].[InvoiceComment] AS [InvoiceComment],
[Extent2].[PickListComment] AS [PickListComment],
[Extent2].[DepositBal] AS [DepositBal],
[Extent2].[DocDepositBal] AS [DocDepositBal],
[Extent2].[NeedByDate] AS [NeedByDate],
[Extent2].[CreditOverride] AS [CreditOverride],
[Extent2].[CreditOverrideUserID] AS [CreditOverrideUserID],
[Extent2].[CreditOverrideDate] AS [CreditOverrideDate],
[Extent2].[CreditOverrideTime] AS [CreditOverrideTime],
[Extent2].[CreditOverrideLimit] AS [CreditOverrideLimit],
[Extent2].[SndAlrtShp] AS [SndAlrtShp],
[Extent2].[ExchangeRate] AS [ExchangeRate],
[Extent2].[CurrencyCode] AS [CurrencyCode],
[Extent2].[LockRate] AS [LockRate],
[Extent2].[CardMemberName] AS [CardMemberName],
[Extent2].[CardNumber] AS [CardNumber],
[Extent2].[CardType] AS [CardType],
[Extent2].[ExpirationMonth] AS [ExpirationMonth],
[Extent2].[ExpirationYear] AS [ExpirationYear],
[Extent2].[CardID] AS [CardID],
[Extent2].[CardmemberReference] AS [CardmemberReference],
[Extent2].[AllocPriorityCode] AS [AllocPriorityCode],
[Extent2].[ReservePriorityCode] AS [ReservePriorityCode],
[Extent2].[ShipOrderComplete] AS [ShipOrderComplete],
[Extent2].[WebOrder] AS [WebOrder],
[Extent2].[CCApprovalNum] AS [CCApprovalNum],
[Extent2].[EDIOrder] AS [EDIOrder],
[Extent2].[EDIAck] AS [EDIAck],
[Extent2].[Linked] AS [Linked],
[Extent2].[ICPONum] AS [ICPONum],
[Extent2].[ExtCompany] AS [ExtCompany],
[Extent2].[WebEntryPerson] AS [WebEntryPerson],
[Extent2].[AckEmailSent] AS [AckEmailSent],
[Extent2].[ApplyOrderBasedDisc] AS [ApplyOrderBasedDisc],
[Extent2].[AutoOrderBasedDisc] AS [AutoOrderBasedDisc],
[Extent2].[EntryMethod] AS [EntryMethod],
[Extent2].[HDCaseNum] AS [HDCaseNum],
[Extent2].[CounterSale] AS [CounterSale],
[Extent2].[CreateInvoice] AS [CreateInvoice],
[Extent2].[CreatePackingSlip] AS [CreatePackingSlip],
[Extent2].[LockQty] AS [LockQty],
[Extent2].[ProcessCard] AS [ProcessCard],
[Extent2].[CCAmount] AS [CCAmount],
[Extent2].[CCFreight] AS [CCFreight],
[Extent2].[CCTax] AS [CCTax],
[Extent2].[CCTotal] AS [CCTotal],
[Extent2].[CCDocAmount] AS [CCDocAmount],
[Extent2].[CCDocFreight] AS [CCDocFreight],
[Extent2].[CCDocTax] AS [CCDocTax],
[Extent2].[CCDocTotal] AS [CCDocTotal],
[Extent2].[CCStreetAddr] AS [CCStreetAddr],
[Extent2].[CCZip] AS [CCZip],
[Extent2].[BTCustNum] AS [BTCustNum],
[Extent2].[BTConNum] AS [BTConNum],
[Extent2].[RepRate4] AS [RepRate4],
[Extent2].[RepRate5] AS [RepRate5],
[Extent2].[RepSplit1] AS [RepSplit1],
[Extent2].[RepSplit2] AS [RepSplit2],
[Extent2].[RepSplit3] AS [RepSplit3],
[Extent2].[RepSplit4] AS [RepSplit4],
[Extent2].[RepSplit5] AS [RepSplit5],
[Extent2].[RepRate1] AS [RepRate1],
[Extent2].[RepRate2] AS [RepRate2],
[Extent2].[RepRate3] AS [RepRate3],
[Extent2].[OutboundSalesDocCtr] AS [OutboundSalesDocCtr],
[Extent2].[OutboundShipDocsCtr] AS [OutboundShipDocsCtr],
[Extent2].[DemandContractNum] AS [DemandContractNum],
[Extent2].[DoNotShipBeforeDate] AS [DoNotShipBeforeDate],
[Extent2].[ResDelivery] AS [ResDelivery],
[Extent2].[DoNotShipAfterDate] AS [DoNotShipAfterDate],
[Extent2].[SatDelivery] AS [SatDelivery],
[Extent2].[SatPickup] AS [SatPickup],
[Extent2].[Hazmat] AS [Hazmat],
[Extent2].[DocOnly] AS [DocOnly],
[Extent2].[RefNotes] AS [RefNotes],
[Extent2].[ApplyChrg] AS [ApplyChrg],
[Extent2].[ChrgAmount] AS [ChrgAmount],
[Extent2].[COD] AS [COD],
[Extent2].[CODFreight] AS [CODFreight],
[Extent2].[CODCheck] AS [CODCheck],
[Extent2].[CODAmount] AS [CODAmount],
[Extent2].[GroundType] AS [GroundType],
[Extent2].[NotifyFlag] AS [NotifyFlag],
[Extent2].[NotifyEMail] AS [NotifyEMail],
[Extent2].[DeclaredIns] AS [DeclaredIns],
[Extent2].[DeclaredAmt] AS [DeclaredAmt],
[Extent2].[CancelAfterDate] AS [CancelAfterDate],
[Extent2].[DemandRejected] AS [DemandRejected],
[Extent2].[OverrideCarrier] AS [OverrideCarrier],
[Extent2].[OverrideService] AS [OverrideService],
[Extent2].[CreditCardOrder] AS [CreditCardOrder],
[Extent2].[DemandHeadSeq] AS [DemandHeadSeq],
[Extent2].[PayFlag] AS [PayFlag],
[Extent2].[PayAccount] AS [PayAccount],
[Extent2].[PayBTAddress1] AS [PayBTAddress1],
[Extent2].[PayBTAddress2] AS [PayBTAddress2],
[Extent2].[PayBTCity] AS [PayBTCity],
[Extent2].[PayBTState] AS [PayBTState],
[Extent2].[PayBTZip] AS [PayBTZip],
[Extent2].[PayBTCountry] AS [PayBTCountry],
[Extent2].[DropShip] AS [DropShip],
[Extent2].[CommercialInvoice] AS [CommercialInvoice],
[Extent2].[ShipExprtDeclartn] AS [ShipExprtDeclartn],
[Extent2].[CertOfOrigin] AS [CertOfOrigin],
[Extent2].[LetterOfInstr] AS [LetterOfInstr],
[Extent2].[FFID] AS [FFID],
[Extent2].[FFAddress1] AS [FFAddress1],
[Extent2].[FFAddress2] AS [FFAddress2],
[Extent2].[FFCity] AS [FFCity],
[Extent2].[FFState] AS [FFState],
[Extent2].[FFZip] AS [FFZip],
[Extent2].[FFCountry] AS [FFCountry],
[Extent2].[FFContact] AS [FFContact],
[Extent2].[FFCompName] AS [FFCompName],
[Extent2].[FFPhoneNum] AS [FFPhoneNum],
[Extent2].[IntrntlShip] AS [IntrntlShip],
[Extent2].[ChangedBy] AS [ChangedBy],
[Extent2].[ChangeDate] AS [ChangeDate],
[Extent2].[ChangeTime] AS [ChangeTime],
[Extent2].[AutoPrintReady] AS [AutoPrintReady],
[Extent2].[EDIReady] AS [EDIReady],
[Extent2].[IndividualPackIDs] AS [IndividualPackIDs],
[Extent2].[FFAddress3] AS [FFAddress3],
[Extent2].[DeliveryConf] AS [DeliveryConf],
[Extent2].[AddlHdlgFlag] AS [AddlHdlgFlag],
[Extent2].[NonStdPkg] AS [NonStdPkg],
[Extent2].[ServSignature] AS [ServSignature],
[Extent2].[ServAlert] AS [ServAlert],
[Extent2].[ServHomeDel] AS [ServHomeDel],
[Extent2].[DeliveryType] AS [DeliveryType],
[Extent2].[ServDeliveryDate] AS [ServDeliveryDate],
[Extent2].[ServInstruct] AS [ServInstruct],
[Extent2].[ServRef1] AS [ServRef1],
[Extent2].[ServRef2] AS [ServRef2],
[Extent2].[ServRef3] AS [ServRef3],
[Extent2].[ServRef4] AS [ServRef4],
[Extent2].[ServRef5] AS [ServRef5],
[Extent2].[FFCountryNum] AS [FFCountryNum],
[Extent2].[ServPhone] AS [ServPhone],
[Extent2].[ServRelease] AS [ServRelease],
[Extent2].[ServAuthNum] AS [ServAuthNum],
[Extent2].[PayBTAddress3] AS [PayBTAddress3],
[Extent2].[PayBTCountryNum] AS [PayBTCountryNum],
[Extent2].[PayBTPhone] AS [PayBTPhone],
[Extent2].[UPSQuantumView] AS [UPSQuantumView],
[Extent2].[UPSQVShipFromName] AS [UPSQVShipFromName],
[Extent2].[UPSQVMemo] AS [UPSQVMemo],
[Extent2].[ReadyToCalc] AS [ReadyToCalc],
[Extent2].[TotalCharges] AS [TotalCharges],
[Extent2].[TotalMisc] AS [TotalMisc],
[Extent2].[TotalDiscount] AS [TotalDiscount],
[Extent2].[TotalComm] AS [TotalComm],
[Extent2].[TotalAdvBill] AS [TotalAdvBill],
[Extent2].[TotalLines] AS [TotalLines],
[Extent2].[TotalReleases] AS [TotalReleases],
[Extent2].[TotalRelDates] AS [TotalRelDates],
[Extent2].[DocTotalCharges] AS [DocTotalCharges],
[Extent2].[DocTotalMisc] AS [DocTotalMisc],
[Extent2].[DocTotalDiscount] AS [DocTotalDiscount],
[Extent2].[DocTotalComm] AS [DocTotalComm],
[Extent2].[TotalTax] AS [TotalTax],
[Extent2].[DocTotalTax] AS [DocTotalTax],
[Extent2].[DocTotalAdvBill] AS [DocTotalAdvBill],
[Extent2].[TotalShipped] AS [TotalShipped],
[Extent2].[TotalInvoiced] AS [TotalInvoiced],
[Extent2].[TotalCommLines] AS [TotalCommLines],
[Extent2].[SRCommAmt1] AS [SRCommAmt1],
[Extent2].[SRCommAmt2] AS [SRCommAmt2],
[Extent2].[SRCommAmt3] AS [SRCommAmt3],
[Extent2].[SRCommAmt4] AS [SRCommAmt4],
[Extent2].[SRCommAmt5] AS [SRCommAmt5],
[Extent2].[SRCommableAmt1] AS [SRCommableAmt1],
[Extent2].[SRCommableAmt2] AS [SRCommableAmt2],
[Extent2].[SRCommableAmt3] AS [SRCommableAmt3],
[Extent2].[SRCommableAmt4] AS [SRCommableAmt4],
[Extent2].[SRCommableAmt5] AS [SRCommableAmt5],
[Extent2].[Rounding] AS [Rounding],
[Extent2].[Rpt1DepositBal] AS [Rpt1DepositBal],
[Extent2].[DocRounding] AS [DocRounding],
[Extent2].[Rpt2DepositBal] AS [Rpt2DepositBal],
[Extent2].[Rpt3DepositBal] AS [Rpt3DepositBal],
[Extent2].[Rpt1TotalCharges] AS [Rpt1TotalCharges],
[Extent2].[Rpt2TotalCharges] AS [Rpt2TotalCharges],
[Extent2].[Rpt3TotalCharges] AS [Rpt3TotalCharges],
[Extent2].[Rpt1TotalAdvBill] AS [Rpt1TotalAdvBill],
[Extent2].[Rpt2TotalAdvBill] AS [Rpt2TotalAdvBill],
[Extent2].[Rpt3TotalAdvBill] AS [Rpt3TotalAdvBill],
[Extent2].[Rpt1TotalMisc] AS [Rpt1TotalMisc],
[Extent2].[Rpt2TotalMisc] AS [Rpt2TotalMisc],
[Extent2].[Rpt3TotalMisc] AS [Rpt3TotalMisc],
[Extent2].[Rpt1TotalDiscount] AS [Rpt1TotalDiscount],
[Extent2].[Rpt2TotalDiscount] AS [Rpt2TotalDiscount],
[Extent2].[Rpt3TotalDiscount] AS [Rpt3TotalDiscount],
[Extent2].[Rpt1TotalComm] AS [Rpt1TotalComm],
[Extent2].[Rpt2TotalComm] AS [Rpt2TotalComm],
[Extent2].[Rpt3TotalComm] AS [Rpt3TotalComm],
[Extent2].[Rpt1TotalTax] AS [Rpt1TotalTax],
[Extent2].[Rpt2TotalTax] AS [Rpt2TotalTax],
[Extent2].[Rpt1Rounding] AS [Rpt1Rounding],
[Extent2].[Rpt2Rounding] AS [Rpt2Rounding],
[Extent2].[Rpt3Rounding] AS [Rpt3Rounding],
[Extent2].[RateGrpCode] AS [RateGrpCode],
[Extent2].[Rpt3TotalTax] AS [Rpt3TotalTax],
[Extent2].[Rpt1CCAmount] AS [Rpt1CCAmount],
[Extent2].[Rpt2CCAmount] AS [Rpt2CCAmount],
[Extent2].[Rpt3CCAmount] AS [Rpt3CCAmount],
[Extent2].[Rpt1CCFreight] AS [Rpt1CCFreight],
[Extent2].[Rpt2CCFreight] AS [Rpt2CCFreight],
[Extent2].[Rpt3CCFreight] AS [Rpt3CCFreight],
[Extent2].[Rpt1CCTax] AS [Rpt1CCTax],
[Extent2].[Rpt2CCTax] AS [Rpt2CCTax],
[Extent2].[Rpt3CCTax] AS [Rpt3CCTax],
[Extent2].[Rpt1CCTotal] AS [Rpt1CCTotal],
[Extent2].[Rpt2CCTotal] AS [Rpt2CCTotal],
[Extent2].[Rpt3CCTotal] AS [Rpt3CCTotal],
[Extent2].[OrderAmt] AS [OrderAmt],
[Extent2].[DocOrderAmt] AS [DocOrderAmt],
[Extent2].[Rpt1OrderAmt] AS [Rpt1OrderAmt],
[Extent2].[Rpt2OrderAmt] AS [Rpt2OrderAmt],
[Extent2].[Rpt3OrderAmt] AS [Rpt3OrderAmt],
[Extent2].[TaxPoint] AS [TaxPoint],
[Extent2].[TaxRateDate] AS [TaxRateDate],
[Extent2].[TaxRegionCode] AS [TaxRegionCode],
[Extent2].[UseOTS] AS [UseOTS],
[Extent2].[OTSName] AS [OTSName],
[Extent2].[OTSAddress1] AS [OTSAddress1],
[Extent2].[OTSAddress2] AS [OTSAddress2],
[Extent2].[OTSAddress3] AS [OTSAddress3],
[Extent2].[OTSCity] AS [OTSCity],
[Extent2].[OTSState] AS [OTSState],
[Extent2].[OTSZIP] AS [OTSZIP],
[Extent2].[OTSResaleID] AS [OTSResaleID],
[Extent2].[OTSContact] AS [OTSContact],
[Extent2].[OTSFaxNum] AS [OTSFaxNum],
[Extent2].[OTSPhoneNum] AS [OTSPhoneNum],
[Extent2].[OTSCountryNum] AS [OTSCountryNum],
[Extent2].[TotalWHTax] AS [TotalWHTax],
[Extent2].[DocTotalWHTax] AS [DocTotalWHTax],
[Extent2].[Rpt1TotalWHTax] AS [Rpt1TotalWHTax],
[Extent2].[Rpt2TotalWHTax] AS [Rpt2TotalWHTax],
[Extent2].[Rpt3TotalWHTax] AS [Rpt3TotalWHTax],
[Extent2].[TotalSATax] AS [TotalSATax],
[Extent2].[DocTotalSATax] AS [DocTotalSATax],
[Extent2].[Rpt1TotalSATax] AS [Rpt1TotalSATax],
[Extent2].[Rpt2TotalSATax] AS [Rpt2TotalSATax],
[Extent2].[Rpt3TotalSATax] AS [Rpt3TotalSATax],
[Extent2].[OTSSaveAs] AS [OTSSaveAs],
[Extent2].[OTSSaveCustID] AS [OTSSaveCustID],
[Extent2].[OTSCustSaved] AS [OTSCustSaved],
[Extent2].[ShipToCustNum] AS [ShipToCustNum],
[Extent2].[OrderStatus] AS [OrderStatus],
[Extent2].[HoldSetByDemand] AS [HoldSetByDemand],
[Extent2].[InPrice] AS [InPrice],
[Extent2].[InTotalCharges] AS [InTotalCharges],
[Extent2].[InTotalMisc] AS [InTotalMisc],
[Extent2].[InTotalDiscount] AS [InTotalDiscount],
[Extent2].[DocInTotalCharges] AS [DocInTotalCharges],
[Extent2].[DocInTotalMisc] AS [DocInTotalMisc],
[Extent2].[DocInTotalDiscount] AS [DocInTotalDiscount],
[Extent2].[Rpt1InTotalCharges] AS [Rpt1InTotalCharges],
[Extent2].[Rpt2InTotalCharges] AS [Rpt2InTotalCharges],
[Extent2].[Rpt3InTotalCharges] AS [Rpt3InTotalCharges],
[Extent2].[Rpt1InTotalMisc] AS [Rpt1InTotalMisc],
[Extent2].[Rpt2InTotalMisc] AS [Rpt2InTotalMisc],
[Extent2].[Rpt3InTotalMisc] AS [Rpt3InTotalMisc],
[Extent2].[Rpt1InTotalDiscount] AS [Rpt1InTotalDiscount],
[Extent2].[Rpt2InTotalDiscount] AS [Rpt2InTotalDiscount],
[Extent2].[Rpt3InTotalDiscount] AS [Rpt3InTotalDiscount],
[Extent2].[ARLOCID] AS [ARLOCID],
[Extent2].[OurBank] AS [OurBank],
[Extent2].[ERSOrder] AS [ERSOrder],
[Extent2].[LOCHold] AS [LOCHold],
[Extent2].[PSCurrCode] AS [PSCurrCode],
[Extent2].[InvCurrCode] AS [InvCurrCode],
[Extent2].[LegalNumber] AS [LegalNumber],
[Extent2].[TranDocTypeID] AS [TranDocTypeID],
[Extent2].[XRefContractNum] AS [XRefContractNum],
[Extent2].[XRefContractDate] AS [XRefContractDate],
[Extent2].[DemandProcessDate] AS [DemandProcessDate],
[Extent2].[DemandProcessTime] AS [DemandProcessTime],
[Extent2].[LastScheduleNumber] AS [LastScheduleNumber],
[Extent2].[LastTCtrlNum] AS [LastTCtrlNum],
[Extent2].[LastBatchNum] AS [LastBatchNum],
[Extent2].[ECCOrderNum] AS [ECCOrderNum],
[Extent2].[ECCPONum] AS [ECCPONum],
[Extent2].[WIOrder] AS [WIOrder],
[Extent2].[WIApplication] AS [WIApplication],
[Extent2].[WIUsername] AS [WIUsername],
[Extent2].[WIUserID] AS [WIUserID],
[Extent2].[WICreditCardorder] AS [WICreditCardorder],
[Extent2].[OrderCSR] AS [OrderCSR],
[Extent2].[UserChar1] AS [UserChar1],
[Extent2].[UserChar2] AS [UserChar2],
[Extent2].[UserChar3] AS [UserChar3],
[Extent2].[UserChar4] AS [UserChar4],
[Extent2].[UserDate1] AS [UserDate1],
[Extent2].[UserDate2] AS [UserDate2],
[Extent2].[UserDate3] AS [UserDate3],
[Extent2].[UserDate4] AS [UserDate4],
[Extent2].[UserDecimal1] AS [UserDecimal1],
[Extent2].[UserDecimal2] AS [UserDecimal2],
[Extent2].[UserInteger1] AS [UserInteger1],
[Extent2].[UserInteger2] AS [UserInteger2],
[Extent2].[SysRevID] AS [SysRevID],
[Extent1].[ForeignSysRowID] AS [ForeignSysRowID],
[Extent2].[IsCSRSet] AS [IsCSRSet],
[Extent2].[ECCPaymentMethod] AS [ECCPaymentMethod],
[Extent2].[AGUseGoodDefaultMark] AS [AGUseGoodDefaultMark],
[Extent2].[OTSShipToNum] AS [OTSShipToNum],
[Extent2].[ProFormaInvComment] AS [ProFormaInvComment],
[Extent2].[ccToken] AS [ccToken],
[Extent2].[InvcOrderCmp] AS [InvcOrderCmp],
[Extent2].[ReprintSOAck] AS [ReprintSOAck],
[Extent2].[CounterSOAck] AS [CounterSOAck],
[Extent2].[DispatchReason] AS [DispatchReason],
[Extent2].[Plant] AS [Plant],
[Extent2].[ReadyToFulfill] AS [ReadyToFulfill],
[Extent2].[ShipByTime] AS [ShipByTime],
[Extent2].[TWFiscalYear] AS [TWFiscalYear],
[Extent2].[TWFiscalYearSuffix] AS [TWFiscalYearSuffix],
[Extent2].[TWFiscalPeriod] AS [TWFiscalPeriod],
[Extent2].[TWGUIGroup] AS [TWGUIGroup],
[Extent2].[TWGUIRegNumSeller] AS [TWGUIRegNumSeller],
[Extent2].[TWGUIRegNumBuyer] AS [TWGUIRegNumBuyer],
[Extent2].[OrderOpenCredit] AS [OrderOpenCredit],
[Extent2].[ClosedNotShipped] AS [ClosedNotShipped],
[Extent1].[Character01] AS [Character01],
[Extent1].[Character02] AS [Character02],
[Extent1].[Character03] AS [Character03],
[Extent1].[Character04] AS [Character04],
[Extent1].[Character05] AS [Character05],
[Extent1].[Character06] AS [Character06],
[Extent1].[Character07] AS [Character07],
[Extent1].[Character08] AS [Character08],
[Extent1].[Character09] AS [Character09],
[Extent1].[Character10] AS [Character10],
[Extent1].[Number01] AS [Number01],
[Extent1].[Number02] AS [Number02],
[Extent1].[Number03] AS [Number03],
[Extent1].[Number05] AS [Number05],
[Extent1].[Number06] AS [Number06],
[Extent1].[Number07] AS [Number07],
[Extent1].[Date01] AS [Date01],
[Extent1].[Date03] AS [Date03],
[Extent1].[Date04] AS [Date04],
[Extent1].[Date05] AS [Date05],
[Extent1].[CheckBox01] AS [CheckBox01],
[Extent1].[CheckBox02] AS [CheckBox02],
[Extent1].[CheckBox03] AS [CheckBox03],
[Extent1].[CheckBox05] AS [CheckBox05],
[Extent1].[Number19] AS [Number19],
[Extent1].[Number20] AS [Number20],
[Extent1].[Date10] AS [Date10],
[Extent1].[Date11] AS [Date11],
[Extent1].[CheckBox06] AS [CheckBox06],
[Extent1].[CheckBox07] AS [CheckBox07],
[Extent1].[CheckBox10] AS [CheckBox10],
[Extent1].[CheckBox11] AS [CheckBox11],
[Extent1].[CheckBox12] AS [CheckBox12],
[Extent1].[CheckBox16] AS [CheckBox16],
[Extent1].[CheckBox17] AS [CheckBox17],
[Extent1].[CheckBox18] AS [CheckBox18],
[Extent1].[CheckBox19] AS [CheckBox19],
[Extent1].[CheckBox20] AS [CheckBox20],
[Extent1].[ShortChar01] AS [ShortChar01],
[Extent1].[ShortChar02] AS [ShortChar02],
[Extent1].[ShortChar03] AS [ShortChar03],
[Extent1].[ShortChar04] AS [ShortChar04],
[Extent1].[ShortChar05] AS [ShortChar05],
[Extent1].[ShortChar06] AS [ShortChar06],
[Extent1].[ShortChar07] AS [ShortChar07],
[Extent1].[ShortChar08] AS [ShortChar08],
[Extent1].[ShortChar09] AS [ShortChar09],
[Extent1].[ShortChar10] AS [ShortChar10],
[Extent1].[UD_SysRevID] AS [UD_SysRevID],
[Extent1].[CustName_c] AS [CustName_c],
[Extent1].[Number10] AS [Number10],
[Extent1].[PMEmail_c] AS [PMEmail_c],
[Extent1].[RepEmail_c] AS [RepEmail_c],
[Extent1].[ShipWhenReady_c] AS [ShipWhenReady_c],
[Extent1].[InstallOrderInt_c] AS [InstallOrderInt_c],
[Extent1].[Offset_c] AS [Offset_c],
[Extent1].[SeatCount_c] AS [SeatCount_c],
[Extent1].[PSalesCat_c] AS [PSalesCat_c],
[Extent1].[PM_ConstPermit_c] AS [PM_ConstPermit_c],
[Extent1].[PM_ConstSchedValid_c] AS [PM_ConstSchedValid_c],
[Extent1].[PM_CoreDrillPlan_c] AS [PM_CoreDrillPlan_c],
[Extent1].[PM_CoreDrillPlanNA_c] AS [PM_CoreDrillPlanNA_c],
[Extent1].[PM_DepositRcv_c] AS [PM_DepositRcv_c],
[Extent1].[PM_DepositRcvNA_c] AS [PM_DepositRcvNA_c],
[Extent1].[PM_FieldDim_c] AS [PM_FieldDim_c],
[Extent1].[PM_FieldDimNA_c] AS [PM_FieldDimNA_c],
[Extent1].[PM_FinalPlanSet_c] AS [PM_FinalPlanSet_c],
[Extent1].[PM_FinalPlanSetNA_c] AS [PM_FinalPlanSetNA_c],
[Extent1].[PM_FinalSiteReady_c] AS [PM_FinalSiteReady_c],
[Extent1].[PM_OrderApproved_c] AS [PM_OrderApproved_c],
[Extent1].[PM_OrderApprovedNA_c] AS [PM_OrderApprovedNA_c],
[Extent1].[PM_OrderComfirm_c] AS [PM_OrderComfirm_c],
[Extent1].[PM_SignedContract_c] AS [PM_SignedContract_c],
[Extent1].[PM_SiteContactInfo_c] AS [PM_SiteContactInfo_c],
[Extent1].[PM_TwoWeekNotice_c] AS [PM_TwoWeekNotice_c]
FROM [Erp].[OrderHed_UD] AS [Extent1] WITH (UPDLOCK)
INNER JOIN [Erp].[OrderHed] AS [Extent2] WITH (UPDLOCK) ON [Extent1].[ForeignSysRowID] = [Extent2].[SysRowID]
WHERE ([Extent1].[ForeignSysRowID] = @p__linq__0) AND (@p__linq__0 IS NOT NULL)