clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3799367 fiddles created (41676 in the last week).

CREATE TABLE dbo.Transactions ( TransactionID bigint NOT NULL, ClientID integer NOT NULL, TransactionDate datetime2(2) NOT NULL, CONSTRAINT PK_dbo_Transactions PRIMARY KEY CLUSTERED (TransactionID), INDEX dbo_Transactions_ClientID_TranDate (ClientID, TransactionDate) ); CREATE TABLE #Working ( TransactionID bigint NULL, ClientID integer NULL, TransactionDate datetime2(2) NULL, INDEX cx CLUSTERED (TransactionID) );
 hidden batch(es)


INSERT dbo.Transactions (TransactionID, ClientID, TransactionDate) VALUES (1, 1, '2019-01-01'); INSERT #Working (TransactionID, ClientID, TransactionDate) VALUES (1, 2, NULL), (1, NULL, '2019-03-03'), (1, 3, NULL), (1, NULL, '2019-02-02');
5 rows affected
 hidden batch(es)


set statistics xml on; UPDATE T SET T.TransactionID = W.TransactionID, T.ClientID = W.ClientID, T.TransactionDate = W.TransactionDate FROM #Working AS W JOIN dbo.Transactions AS T ON T.TransactionID = W.TransactionID; set statistics xml off;
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.481" Build="14.0.3335.7"><BatchSequence><Batch><Statements><StmtSimple StatementText="UPDATE T&#xa;SET T.TransactionID = W.TransactionID,&#xa; T.ClientID = W.ClientID,&#xa; T.TransactionDate = W.TransactionDate&#xa;FROM #Working AS W&#xa;JOIN dbo.Transactions AS T&#xa; ON T.TransactionID = W.TransactionID" StatementId="1" StatementCompId="2" StatementType="UPDATE" RetrievedFromCache="true" StatementSubTreeCost="0.0548442" StatementEstRows="3" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x5E6580608789892D" QueryPlanHash="0x8BDBCAEE55D33B61" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="140"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" MemoryGrant="1024" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="56" CompileTime="15" CompileCPU="15" CompileMemory="320"><MemoryGrantInfo SerialRequiredMemory="512" SerialDesiredMemory="544" RequiredMemory="512" DesiredMemory="544" RequestedMemory="1024" GrantWaitTime="0" GrantedMemory="1024" MaxUsedMemory="16" MaxQueryMemory="520544"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="838808" EstimatedPagesCached="52425" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1212944"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2022-06-06T07:59:14.56" ModificationCount="0" SamplingPercent="100" Statistics="[cx]" Table="[#Working____________________________________________________________________________________________________________000000000164]" Schema="[dbo]" Database="[tempdb]"></StatisticsInfo><StatisticsInfo LastUpdate="2022-06-06T07:59:14.56" ModificationCount="0" SamplingPercent="100" Statistics="[PK_dbo_Transactions]" Table="[Transactions]" Schema="[dbo]" Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]"></StatisticsInfo></OptimizerStatsUsage><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="1" PhysicalOp="Index Update" LogicalOp="Update" EstimateRows="3" EstimateIO="0.0235135" EstimateCPU="3e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0548442" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="4" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Update DMLRequestSort="0"><Object Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Index="[dbo_Transactions_ClientID_TranDate]" Alias="[T]" IndexKind="NonClustered" Storage="RowStore"></Object><SetPredicate><ScalarOperator ScalarString="[TransactionID1008] = [fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionID] as [T].[TransactionID],[ClientID1009] = [fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[ClientID] as [T].[ClientID],[TransactionDate1010] = [fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionDate] as [T].[TransactionDate]"><ScalarExpressionList><ScalarOperator><MultipleAssign><Assign><ColumnReference Column="TransactionID1008"></ColumnReference><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference></Identifier></ScalarOperator></Assign><Assign><ColumnReference Column="ClientID1009"></ColumnReference><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference></Identifier></ScalarOperator></Assign><Assign><ColumnReference Column="TransactionDate1010"></ColumnReference><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></Identifier></ScalarOperator></Assign></MultipleAssign></ScalarOperator></ScalarExpressionList></ScalarOperator></SetPredicate><ActionColumn><ColumnReference Column="Act1007"></ColumnReference></ActionColumn><RelOp NodeId="2" PhysicalOp="Split" LogicalOp="Split" EstimateRows="3" EstimateIO="0" EstimateCPU="2.25e-006" AvgRowSize="29" EstimatedTotalSubtreeCost="0.0313277" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ColumnReference Column="Act1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Split><DefinedValues><DefinedValue><ColumnReference Column="Act1007"></ColumnReference></DefinedValue></DefinedValues><ActionColumn><ColumnReference Column="Act1007"></ColumnReference></ActionColumn><RelOp NodeId="3" PhysicalOp="Clustered Index Update" LogicalOp="Update" EstimateRows="1.5" EstimateIO="0.0133784" EstimateCPU="1.5e-006" AvgRowSize="47" EstimatedTotalSubtreeCost="0.0313255" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ColumnReference Column="TransactionID_OLD"></ColumnReference><ColumnReference Column="ClientID_OLD"></ColumnReference><ColumnReference Column="TransactionDate_OLD"></ColumnReference><ColumnReference Column="Act1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Update DMLRequestSort="1"><Object Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Index="[PK_dbo_Transactions]" Alias="[T]" IndexKind="Clustered" Storage="RowStore"></Object><SetPredicate SetPredicateType="Insert"><ScalarOperator ScalarString="[fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionID] as [T].[TransactionID] = RaiseIfNullUpdate([fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionID] as [T].[TransactionID]),[fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[ClientID] as [T].[ClientID] = RaiseIfNullUpdate([fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[ClientID] as [T].[ClientID]),[fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionDate] as [T].[TransactionDate] = RaiseIfNullUpdate([fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionDate] as [T].[TransactionDate])"><ScalarExpressionList><ScalarOperator><MultipleAssign><Assign><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullUpdate"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign><Assign><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullUpdate"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign><Assign><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullUpdate"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign></MultipleAssign></ScalarOperator></ScalarExpressionList></ScalarOperator></SetPredicate><SetPredicate SetPredicateType="Update"><ScalarOperator ScalarString="[fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[ClientID] as [T].[ClientID] = RaiseIfNullUpdate([fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[ClientID] as [T].[ClientID]),[fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionDate] as [T].[TransactionDate] = RaiseIfNullUpdate([fiddle_f04797ae86a04ea98edefd55c09ead34].[dbo].[Transactions].[TransactionDate] as [T].[TransactionDate])"><ScalarExpressionList><ScalarOperator><MultipleAssign><Assign><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullUpdate"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign><Assign><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullUpdate"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign></MultipleAssign></ScalarOperator></ScalarExpressionList></ScalarOperator></SetPredicate><ActionColumn><ColumnReference Column="Act1007"></ColumnReference></ActionColumn><RelOp NodeId="4" PhysicalOp="Collapse" LogicalOp="Collapse" EstimateRows="1.5" EstimateIO="0" EstimateCPU="3.5e-006" AvgRowSize="29" EstimatedTotalSubtreeCost="0.0179456" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ColumnReference Column="Act1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Collapse><GroupBy><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference></GroupBy><RelOp NodeId="5" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="2" EstimateIO="0.0112613" EstimateCPU="0.000103157" AvgRowSize="37" EstimatedTotalSubtreeCost="0.0179421" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ColumnReference Column="Act1007"></ColumnReference></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1024" OutputMemoryGrant="640" UsedMemoryGrant="16"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Column="Act1007"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="6" PhysicalOp="Split" LogicalOp="Split" EstimateRows="2" EstimateIO="0" EstimateCPU="1.5e-006" AvgRowSize="37" EstimatedTotalSubtreeCost="0.00657768" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference><ColumnReference Column="Act1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Split><DefinedValues><DefinedValue><ColumnReference Column="Act1007"></ColumnReference></DefinedValue></DefinedValues><ActionColumn><ColumnReference Column="Act1007"></ColumnReference></ActionColumn><RelOp NodeId="7" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="4.18e-006" AvgRowSize="43" EstimatedTotalSubtreeCost="0.00657618" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><OuterReferences><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference></OuterReferences><RelOp NodeId="8" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="2.5e-006" AvgRowSize="25" EstimatedTotalSubtreeCost="0.0032889" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference><ScalarOperator ScalarString="ANY([tempdb].[dbo].[#Working].[ClientID] as [W].[ClientID])"><Aggregate Distinct="0" AggType="ANY"><ScalarOperator><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference><ScalarOperator ScalarString="ANY([tempdb].[dbo].[#Working].[TransactionDate] as [W].[TransactionDate])"><Aggregate Distinct="0" AggType="ANY"><ScalarOperator><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference></GroupBy><RelOp NodeId="9" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="4" EstimatedRowsRead="4" EstimateIO="0.003125" EstimateCPU="0.0001614" AvgRowSize="25" EstimatedTotalSubtreeCost="0.0032864" TableCardinality="4" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="4" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="4" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="ClientID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionDate"></ColumnReference></DefinedValue></DefinedValues><Object Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Index="[cx]" Alias="[W]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></StreamAggregate></RelOp><RelOp NodeId="10" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimatedRowsRead="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="25" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="1" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="0" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="ClientID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionDate"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Index="[PK_dbo_Transactions]" Alias="[T]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_f04797ae86a04ea98edefd55c09ead34]" Schema="[dbo]" Table="[Transactions]" Alias="[T]" Column="TransactionID"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[tempdb].[dbo].[#Working].[TransactionID] as [W].[TransactionID]"><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#Working]" Alias="[W]" Column="TransactionID"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></NestedLoops></RelOp></Split></RelOp></Sort></RelOp></Collapse></RelOp></Update></RelOp></Split></RelOp></Update></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)


SELECT T.TransactionID, T.ClientID, T.TransactionDate FROM dbo.Transactions AS T;
TransactionID ClientID TransactionDate
1 2 2019-03-03 00:00:00.00
 hidden batch(es)