Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/SqlBulkSyncFunction/Helpers/SqlCommandExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ public static void MergeData(
ILogger logger
)
{
var rowCount = targetConn.Query<long>(
commandTimeout: 500000,
sql: tableSchema.MergeNewOrUpdateStatement
).First();
logger.LogInformation("{Scope} {RowCount} records merged", scope, rowCount);
try
{
var rowCount = targetConn.Query<long>(
commandTimeout: 500000,
sql: tableSchema.MergeNewOrUpdateStatement
).First();
logger.LogInformation("{Scope} {RowCount} records merged", scope, rowCount);
}
catch(Exception ex)
{
logger.LogError(ex, "Merge failed for {Scope} with statement {MergeNewOrUpdateStatement}\r\n{Exception}", scope, tableSchema.MergeNewOrUpdateStatement, ex.Message);
throw;
}
}

public static void DeleteData(
Expand Down
9 changes: 5 additions & 4 deletions src/SqlBulkSyncFunction/Helpers/SqlStatementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@ THEN UPDATE
),
(
(tableSchema.TargetVersion.CurrentVersion < 0)
? """
? string.Empty
//"""

WHEN NOT MATCHED BY SOURCE
THEN DELETE
"""
//WHEN NOT MATCHED BY SOURCE
// THEN DELETE
//"""
: string.Empty
),
(
Expand Down
Loading