/// <summary>
 /// Retrieves multiple result sets from the specified tables.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="firstTable">The first table to select from.</param>
 /// <param name="secondTable">The second table to select from.</param>
 /// <param name="otherTables">Other tables to select from.</param>
 public static FromManyChainer FromMany(this IAny prev,
                                        TableArgument firstTable,
                                        TableArgument secondTable,
                                        params TableArgument[] otherTables)
 {
     return(new FromManyChainer((Chainer)prev, firstTable, secondTable, otherTables));
 }
Example #2
0
        /// <summary>
        /// Executes a bulk insert.
        /// </summary>
        /// <param name="data">The data to be inserted.</param>
        /// <param name="table">Is a target table where the data is inserted.</param>
        public static Result BulkInsertGo(this Result <DataTable> data, TableArgument table)
        {
            if (data == null)
            {
                throw new QueryTalkException("extensions.BulkInsertGo<T>", QueryTalkExceptionType.ArgumentNull, "result = null", Text.Method.BulkInsertGo);
            }

            return(Importer.ExecuteBulkInsert(Assembly.GetCallingAssembly(), data.ToDataTable(), table, null));
        }
Example #3
0
        /// <summary>
        /// Executes a bulk insert.
        /// </summary>
        /// <param name="data">The data to be inserted.</param>
        /// <param name="table">Is a target table where the data is inserted.</param>
        public static Result BulkInsertGo(Result <DataTable> data, TableArgument table)
        {
            return(Call <Result>(Assembly.GetCallingAssembly(), (ca) =>
            {
                if (table == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "table", Wall.Text.Method.BulkInsertGo);
                }
                if (data == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "data", Wall.Text.Method.BulkInsertGo);
                }

                return Importer.ExecuteBulkInsert(ca, data.ToDataTable(), table, null);
            }));
        }
Example #4
0
        /// <summary>
        /// Retrieves multiple result sets from the specified tables.
        /// </summary>
        /// <param name="firstTable">The first table to select from.</param>
        /// <param name="secondTable">The second table to select from.</param>
        /// <param name="otherTables">Other tables to select from.</param>
        public static FromManyChainer FromMany(TableArgument firstTable, TableArgument secondTable, params TableArgument[] otherTables)
        {
            return(Call <FromManyChainer>(Assembly.GetCallingAssembly(), (ca) =>
            {
                if (firstTable == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "firstTable", Wall.Text.Method.FromMany);
                }

                if (secondTable == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "secondTable", Wall.Text.Method.FromSelect);
                }

                if (otherTables == null)
                {
                    _Throw(QueryTalkExceptionType.ArgumentNull, "otherTables", Wall.Text.Method.FromSelect);
                }

                var root = new d();
                return new FromManyChainer(root, firstTable, secondTable, otherTables);
            }));
        }
 /// <summary>
 /// Truncates the table.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">A table name argument.</param>
 public static TruncateTableChainer TruncateTable(this IAny prev, TableArgument table)
 {
     return(new TruncateTableChainer((Chainer)prev, table));
 }
Example #6
0
 /// <summary>
 /// Declares a table-valued parameter.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="parameter">Is the name of a table variable parameter. The name must begin with the at sign (@) and should follow the rules for regular SQL identifiers.</param>
 /// <param name="userDefinedTableType">Is a user-defined table type identifier.</param>
 public static TableParamChainer TableParam(this IParam prev, string parameter, TableArgument userDefinedTableType)
 {
     return(new TableParamChainer((Chainer)prev, parameter, DT.Udtt, userDefinedTableType));
 }
 /// <summary>
 /// Declares a table variable of a specified user-defined table type.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="variable">A variable name.</param>
 /// <param name="userDefinedType">A user-defined table type.</param>
 public static DeclareChainer DeclareTable(this IAny prev, string variable, TableArgument userDefinedType)
 {
     return(new DeclareChainer((Chainer)prev, variable, DT.Udtt, userDefinedType));
 }
Example #8
0
 /// <summary>
 /// Generates the OUTPUT INTO clause.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="target">Specifies a table that the returned rows are inserted into instead of being returned to the caller.</param>
 public static OutputIntoChainer Into(this OutputChainer prev, TableArgument target)
 {
     return(new OutputIntoChainer((Chainer)prev, target));
 }
Example #9
0
 /// <summary>
 /// Sets a user-defined type of a table which will receive data passed by this view.
 /// </summary>
 /// <param name="userDefinedType">A user-defined type name.</param>
 public View ForUdt(TableArgument userDefinedType)
 {
     UserDefinedType = userDefinedType;
     return(this);
 }
Example #10
0
 /// <summary>
 /// Allows explicit values to be inserted into the identity column of a table. At any time, only one table in a session can have the IDENTITY_INSERT property set to ON. If a table already has this property set to ON, and a SET IDENTITY_INSERT ON statement is issued for another table, SQL Server returns an error message that states SET IDENTITY_INSERT is already ON.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 /// <param name="table">Is a table argument.</param>
 /// <param name="setOn">Specifies whether the IDENTITY_INSERT property is set to ON (TRUE) or OFF (FALSE).</param>
 public static SetIdentityInsertChainer SetIdentityInsert(this IAny prev, TableArgument table, bool setOn)
 {
     return(new SetIdentityInsertChainer((Chainer)prev, table, setOn));
 }