MultipleActiveResultSets=True or multiple connections?

Multiple Active Result Sets (MARS) was added specifically for this type of operation so that you don’t have to have two connections open at the same time to be able to read from a SqlDataReader AND execute additional batches.

MARS is compatible with SQL Server 2005 and above. To quote from MSDN docs:

Before the introduction of Multiple
Active Result Sets (MARS), developers
had to use either multiple connections
or server-side cursors to solve
certain scenarios.

For more info see:

MSDN Library – MARS Overview

Worked example reading and updating data:

MSDN Library – Manipulating Data (MARS) scroll down to ‘Reading and Updating Data with MARS’

Leave a Comment