public void InsertAdvancedClause(SqlFragment parent, InsertAdvancedClause insertAdvancedClause) { this.Script.OpenParen(); Column[] cols = insertAdvancedClause.Args.Select(v => v.Column).ToArray(); ExpressionFormatter.FormatColumnList(cols, insertAdvancedClause, this.Script, this); this.Script.CloseParen(); this.Script.Append(TSqlKeyword.VALUES).OpenParen(); Expression[] values = insertAdvancedClause.Args.Select(v => v.Expression).ToArray(); ExpressionFormatter.FormatExpressionList(values, insertAdvancedClause, this.Script, this); this.Script.CloseParen(); }
public void ExpressionAssignValues(SqlFragment parent, ExpressionAssignValues expressionAssignValues) { IEnumerable <Column> columns = expressionAssignValues.ValueAssignList.Select(v => v.Column); IEnumerable <Expression> expressions = expressionAssignValues.ValueAssignList.Select(v => v.Expression); this.Script.OpenParen(); ExpressionFormatter.FormatColumnList(columns, expressionAssignValues, this.Script, this); this.Script.CloseParen(); this.Script.AppendLine("VALUES ("); ExpressionFormatter.FormatExpressionList(expressions, expressionAssignValues, this.Script, this); this.Script.CloseParen(); }
public void InsertTopIntoTable(SqlFragment parent, InsertTopIntoTable insertTopIntoTable) { this.Script.Append("INSERT TOP ("); this.Script.AppendFragment(insertTopIntoTable.Top, insertTopIntoTable, this); this.Script.Append(") INTO"); this.Script.AppendFragment(insertTopIntoTable.Table, insertTopIntoTable, this); if (insertTopIntoTable.ColumnList.Any()) { this.Script.Append("("); ExpressionFormatter.FormatColumnList(insertTopIntoTable.ColumnList, insertTopIntoTable, this.Script, this); this.Script.Append(")"); } }
public void InsertIntoTable(SqlFragment parent, InsertIntoTable insertIntoTable) { this.Script.Append(TSqlKeyword.INSERT_INTO); this.Script.AppendFragment(insertIntoTable.Table, insertIntoTable, this); if (!insertIntoTable.ColumnList.Any()) { return; } this.Script.OpenParen(); ExpressionFormatter.FormatColumnList(insertIntoTable.ColumnList, insertIntoTable, this.Script, this); this.Script.CloseParen(); }