Share Link
Copied to clipboard
Embed on Your Page
Copied to clipboard
We Stand with Ukraine
Bulk Operations - Logging - LogDump by ZZZ Projects
-- Executing Command:
MERGE INTO [Customer]  AS DestinationTable
USING
(
SELECT TOP 100 PERCENT * FROM (SELECT @0_0 AS [CustomerID], @0_1 AS [Name], @0_2 AS [Description], @0_3 AS [IsActive], @0_4 AS ZZZ_Index
UNION ALL SELECT @1_0 AS [CustomerID], @1_1 AS [Name], @1_2 AS [Description], @1_3 AS [IsActive], @1_4 AS ZZZ_Index
UNION ALL SELECT @2_0 AS [CustomerID], @2_1 AS [Name], @2_2 AS [Description], @2_3 AS [IsActive], @2_4 AS ZZZ_Index) AS StagingTable ORDER BY ZZZ_Index
) AS StagingTable
ON DestinationTable.[CustomerID] = StagingTable.[CustomerID]
WHEN MATCHED   THEN
UPDATE
SET     [Name] = StagingTable.[Name], [Description] = StagingTable.[Description], [IsActive] = StagingTable.[IsActive]
WHEN NOT MATCHED THEN
INSERT ( [Name], [Description], [IsActive] )
VALUES ( [Name], [Description], [IsActive] )

;
-- @0_0: 0 (Type = Int32, Size = 4)
-- @0_1: Customer_C_Inserted (Type = String, Size = -1)
-- @0_2: Description_Customer_C_Inserted (Type = String, Size = -1)
-- @0_3: False (Type = Boolean, Size = 1)
-- @0_4: 0 (Type = Int32, Size = 0)
-- @1_0: 1 (Type = Int32, Size = 4)
-- @1_1: Customer_A_Updated (Type = String, Size = -1)
-- @1_2: Description_Customer_A_Updated (Type = String, Size = -1)
-- @1_3: False (Type = Boolean, Size = 1)
-- @1_4: 1 (Type = Int32, Size = 0)
-- @2_0: 2 (Type = Int32, Size = 4)
-- @2_1: Customer_B_Updated (Type = String, Size = -1)
-- @2_2: Description_Customer_B_Updated (Type = String, Size = -1)
-- @2_3: False (Type = Boolean, Size = 1)
-- @2_4: 2 (Type = Int32, Size = 0)
-- CommandTimeout:120
-- Executing at 3/4/2025 4:18:11 PM
-- Completed at 3/4/2025 4:18:11 PM
-- Result: 3
Cached Result
Last Run: 8:18:10 am
Compile: 0.24s
Execute: 3.666s
Memory: 1.50Mb
CPU: 0.469s