def pre_exec(self):

        if self.isinsert:
            tbl = self.compiled.statement.table
            seq_column = tbl._autoincrement_column
            insert_has_sequence = seq_column is not None

            if insert_has_sequence:
                self._enable_identity_insert = \
                    seq_column.key in self.compiled_parameters[0] or \
                    (
                        self.compiled.statement.parameters and (
                            (
                                self.compiled.statement._has_multi_parameters
                                and
                                seq_column.key in
                                self.compiled.statement.parameters[0]
                            ) or (
                                not
                                self.compiled.statement._has_multi_parameters
                                and
                                seq_column.key in
                                self.compiled.statement.parameters
                            )
                        )
                    )
            else:
                self._enable_identity_insert = False

            self._select_lastrowid = insert_has_sequence and \
                not self.compiled.returning and \
                not self._enable_identity_insert and \
                not self.executemany

            if self._enable_identity_insert:
                self.root_connection._cursor_execute(
                    self.cursor,
                    self._opt_encode(
                        "SET IDENTITY_INSERT %s ON" %
                        self.dialect.identifier_preparer.format_table(tbl)),
                    (),
                    self)
@print_time
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/base.py/MSExecutionContext.pre_exec--crossover with--dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/utils/timing.py/print_time