private void BuildMergeAsSourceClause(SqlMergeSourceTable mergeSource) { StringBuilder.Append(" "); ConvertTableName(StringBuilder, null, null, null, mergeSource.Name); if (MergeSupportsColumnAliasesInSource) { StringBuilder.AppendLine(); StringBuilder.AppendLine("("); ++Indent; var first = true; foreach (var field in mergeSource.SourceFields) { if (!first) { StringBuilder.AppendLine(", "); } first = false; AppendIndent(); Convert(StringBuilder, field.PhysicalName, ConvertType.NameToQueryField); } --Indent; StringBuilder.AppendLine(); StringBuilder.Append(")"); } }
private void BuildMergeAsSourceClause(SqlMergeSourceTable mergeSource) { mergeSource = ConvertElement(mergeSource); StringBuilder.Append(' '); ConvertTableName(StringBuilder, null, null, null, mergeSource.Name, TableOptions.NotSet); if (MergeSupportsColumnAliasesInSource) { StringBuilder.AppendLine(); StringBuilder.AppendLine(OpenParens); ++Indent; var first = true; foreach (var field in mergeSource.SourceFields) { if (!first) { StringBuilder.AppendLine(Comma); } first = false; AppendIndent(); Convert(StringBuilder, field.PhysicalName, ConvertType.NameToQueryField); } --Indent; StringBuilder.AppendLine(); StringBuilder.Append(')'); } }
protected virtual void BuildMergeSourceQuery(SqlMergeSourceTable mergeSource) { mergeSource = ConvertElement(mergeSource); BuildPhysicalTable(mergeSource.Source, null); BuildMergeAsSourceClause(mergeSource); }