Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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(")");
            }
        }
Ejemplo n.º 4
0
        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();
        }