diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index f20749a..a0acdbc 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -443,10 +443,18 @@ namespace Repository.BackendRepository.Implement using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) { await conn.ExecuteAsync(sb.ToString()); - await conn.ExecuteAsync(sb2.ToString()); } sb.Clear(); + } + + if (sb2.Length > 0) + { + using (TransactionScope scope = new TransactionScope((TransactionScopeOption)TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb2.ToString()); + } + sb2.Clear(); } }