You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varsql1=$"SELECT {string.Join(", ",pkColumns.Select(a =>_commonUtils.QuoteSqlName(a)))}, {string.Join(", ",setColumns.Select(a =>_commonUtils.QuoteSqlName(a)))} INTO {tempTableName} FROM {_commonUtils.QuoteSqlName(updateTableName)} WHERE 1=2";
159
+
try
160
+
{
161
+
upsert._sourceSql=$"select * from {tempTableName}";
varsql1=$"SELECT {string.Join(", ",pkColumns)}, {string.Join(", ",setColumns)} INTO {tempTableName} FROM {_commonUtils.QuoteSqlName(updateTableName)} WHERE 1=2";
206
+
varsql1=$"SELECT {string.Join(", ",pkColumns.Select(a =>_commonUtils.QuoteSqlName(a)))}, {string.Join(", ",setColumns.Select(a =>_commonUtils.QuoteSqlName(a)))} INTO {tempTableName} FROM {_commonUtils.QuoteSqlName(updateTableName)} WHERE 1=2";
158
207
varsb=newStringBuilder().Append("UPDATE ").Append(" a SET \r\n ").Append(string.Join(", \r\n ",setColumns.Select(col =>$"a.{_commonUtils.QuoteSqlName(col)} = b.{_commonUtils.QuoteSqlName(col)}")));
159
208
sb.Append(" \r\nFROM ").Append(_commonUtils.QuoteSqlName(updateTableName)).Append(" a ")
160
209
.Append(" \r\nINNER JOIN ").Append(tempTableName).Append(" b ON ").Append(string.Join(" AND ",pkColumns.Select(col =>$"a.{_commonUtils.QuoteSqlName(col)} = b.{_commonUtils.QuoteSqlName(col)}")));
0 commit comments