public override string ToSql() { if (Fields == null || !Fields.Any()) { return(string.Empty); } var sqlJoinBuilder = new StringBuilder(); var sqlBuilder = new StringBuilder(); var predicateSql = string.Empty; var includeDbName = EntityMapper.SqlGenerator.IncludeDbNameInQuery; var dbNameFormatted = string.Format("[{0}].", DatabaseName); if (PredicateParts != null) { predicateSql = PredicateParts.ToSql(); } else { predicateSql = Predicate == null ? "" : Predicate.ToSql(); } foreach (var join in Joins) { sqlJoinBuilder.Append(join.ToSql()); } sqlBuilder.AppendFormat("{0} [{1}] SET {2} FROM {3}[{4}].[{5}] [{1}] {6} WHERE {7}; ", Verb, TableAlias, SetClause.ToSql(), includeDbName ? dbNameFormatted : "", SchemaName, TableName, sqlJoinBuilder.ToString(), predicateSql); sqlBuilder.Append("SELECT @@ROWCOUNT;"); return(sqlBuilder.ToString()); }
public override void ExplicitVisit(SetClause fragment) { _fragments.Add(fragment); }
public static UpdateStatement UpdateVarParam(this ITableExpression table, IEnumerable <IColumnExpression> columns) { var set = new SetClause(columns.Select(col => col.SetVarParam() as ISetItemExpression).ToArray()); return(new UpdateStatement(table, set, null)); }
public sealed override void ExplicitVisit(SetClause node) { base.ExplicitVisit(node); }
public sealed override void Visit(SetClause node) { base.Visit(node); }
public override void ExplicitVisit(SetClause node) { this.action(node); }