When the first call of merge is of empty array, then it will become
MERGE INTO [TenantClassStudents] AS [t]
USING (
VALUES
) AS [cte] ([ClassId], [StudentId])
ON ([t].[StudentId] = [cte].[StudentId]) AND ([t].[ClassId] = [cte].[ClassId])
WHEN NOT MATCHED BY TARGET
THEN INSERT ([StudentId], [ClassId]) VALUES ([cte].[StudentId], [cte].[ClassId]);
However, after this operation, calling this merge with an non-empty will carry on all the sentences, but the SQL command text is still empty.
When the first call of merge is of empty array, then it will become
However, after this operation, calling this merge with an non-empty will carry on all the sentences, but the SQL command text is still empty.