상속: InsertClause
예제 #1
0
파일: SharpBatch.cs 프로젝트: w0lya/sharpql
        public InsertClause InsertTopInto(Expression top, Table table, params Column[] columns)
        {
            var stm    = new InsertStatement(this);
            var clause = new InsertTopIntoTable(stm, top, table, columns);

            stm.FirstFragment = clause;
            return(clause);
        }
예제 #2
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(")");
            }
        }