CreateTempTableWithAllColumns() публичный статический Метод

Creates a standard temp table with a column for each type.
public static CreateTempTableWithAllColumns ( JET_SESID sesid, TempTableGrbit grbit, JET_TABLEID &tableid ) : JET_COLUMNID>.Dictionary
sesid JET_SESID The session to use.
grbit TempTableGrbit Temporary table options.
tableid JET_TABLEID Returns the temporary table.
Результат JET_COLUMNID>.Dictionary
Пример #1
0
        public void Setup()
        {
            this.instance = new Instance(Guid.NewGuid().ToString(), "RetrieveColumnsPerfTest");
            this.instance.Parameters.NoInformationEvent = true;
            this.instance.Parameters.Recovery           = false;
            this.instance.Init();

            this.session = new Session(this.instance);

            // turn off logging so initialization is faster
            this.columnidDict = SetupHelper.CreateTempTableWithAllColumns(this.session, TempTableGrbit.ForceMaterialization, out this.tableid);

            // Insert a record and position the tableid on it
            using (var transaction = new Transaction(this.session))
                using (var update = new Update(this.session, this.tableid, JET_prep.Insert))
                {
                    Api.SetColumn(this.session, this.tableid, this.columnidDict["boolean"], this.expectedBool);
                    Api.SetColumn(this.session, this.tableid, this.columnidDict["int32"], this.expectedInt32);
                    Api.SetColumn(this.session, this.tableid, this.columnidDict["int64"], this.expectedInt64);
                    Api.SetColumn(this.session, this.tableid, this.columnidDict["guid"], this.expectedGuid);
                    Api.SetColumn(this.session, this.tableid, this.columnidDict["unicode"], this.expectedString, Encoding.Unicode);

                    update.Save();
                    transaction.Commit(CommitTransactionGrbit.None);
                }

            Api.TryMoveFirst(this.session, this.tableid);
            Thread.CurrentThread.Priority = ThreadPriority.Highest;
            Thread.BeginThreadAffinity();
        }
Пример #2
0
        public void Setup()
        {
            this.instance = new Instance(Guid.NewGuid().ToString(), "TempTableFixture");
            this.instance.Parameters.Recovery = false;
            this.instance.Parameters.PageTempDBMin = SystemParameters.PageTempDBSmallest;
            this.instance.Parameters.NoInformationEvent = true;
            this.instance.Init();

            this.session = new Session(this.instance);
            this.columnDict = SetupHelper.CreateTempTableWithAllColumns(this.session, TempTableGrbit.None, out this.tableid);
        }
Пример #3
0
        public void Setup()
        {
            this.directory = SetupHelper.CreateRandomDirectory();
            this.instance  = SetupHelper.CreateNewInstance(this.directory);

            // turn off logging so initialization is faster
            Api.JetSetSystemParameter(this.instance, JET_SESID.Nil, JET_param.Recovery, 0, "off");
            Api.JetSetSystemParameter(this.instance, JET_SESID.Nil, JET_param.PageTempDBMin, SystemParameters.PageTempDBSmallest, null);
            Api.JetInit(ref this.instance);
            Api.JetBeginSession(this.instance, out this.sesid, string.Empty, string.Empty);

            this.columnidDict = SetupHelper.CreateTempTableWithAllColumns(this.sesid, TempTableGrbit.None, out this.tableid);
        }