Table Hint

tableHint can be used to optionally pass a table hint when using mssql. The hint must be a value from Sequelize.TableHints and should only be used when absolutely necessary. Only a single table hint is currently supported per query.

Table hints override the default behavior of mssql query optimizer by specifing certain options. They only affect the table or view referenced in that clause.

  1. const TableHints = Sequelize.TableHints;
  2. Project.findAll({
  3. // adding the table hint NOLOCK
  4. tableHint: TableHints.NOLOCK
  5. // this will generate the SQL 'WITH (NOLOCK)'
  6. })