Performance Tips with SqlClient


Here’s a list of things to know if you’d like achieve the best performance/scalability with SqlClient:



  1. Use SqlBulkCopy to send large sets of data to the server

  2. Set DbDataAdapter.UpdateBatchSize to send batches to the server

  3. Use strongly typed getters instead of GetValue/GetSqlValue

  4. Turn on CommandBehavior.SequentialAccess and call GetChars/GetBytes when working with BLOBs

  5. Use parameterized queries (Avoids conversion to and from nchar type)

  6. Wrap multi-step operations in a transaction

  7. Use connection pooling

You might also be interested in check out this article: Improving ADO.NET Performance.

Skip to main content