--- layout: default sidebar: classes title: "SqlServerTableHints" description: "A class that contains all the SQL Server table optimizers." permalink: /class/sqlservertablehints tags: [repodb, sqlservertablehints] parent: CLASSES --- # SqlServerTableHints --- This class contains the list of table hints that is useful for SQL Server. It is usually used as passing parameter to the `hints` argument of most operations. ## Usability To use the hints, simply pass the target hints you want to use. Below is a sample for querying the dirty records. ```csharp using (var connection = new SqlConnection(connectionString)) { var person = connection.QueryAll(hints: SqlServerTableHints.NoLock); } ``` Or only reading the commited records. ```csharp using (var connection = new SqlConnection(connectionString)) { var person = connection.QueryAll(hints: SqlServerTableHints.ReadPast); } ``` Also, below is a sample to lock the table during insertion. ```csharp using (var connection = new SqlConnection(connectionString)) { var id = connection.Insert(person, hints: SqlServerTableHints.TabLock); } ``` Or during the [Update](/operation/update) operation. ```csharp using (var connection = new SqlConnection(connectionString)) { var id = connection.Update(person, hints: SqlServerTableHints.TabLock); } ``` {: .note } > The class contains a lot of hints, we recommend that you visits the official Microsoft [documentation](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-2017) for further understanding.