MARS should be turned off in your Connection String with Sql Server 2005

I've been doing a small amount of testing with the June CTP of Sql Server 2005 and ADO.NET V2.  MARS is turned on by default in a SqlConnection.  I would suggest turning MARS off, unless you need it.  I am seeing a performance difference between having MARS turned on and off, just on regular ADO.NET commands.

You can use the SqlConnectionStringBuilder object and set .MultipleActiveResultSets = False

Wally

Update: Ok, how dumb was this.  I misread my own code.  I was explicitly turning MARS on and off while doing the performance test.  I thought I was only turning this off.  I feel so stupid.

5 Comments

  • Due to the the product being beta and the fact that the license disallows the quoting of performance numbers, I can't quote numbers. I've also been told that the performance problem I have seen is minimized between now and rtm. However, MARS is still an extra service that most applications do not need. Support for it will provide some type of overhead. If you don't need it, don't use it.



    Wally

  • Wow, this has reversed in beta2 - it used to be that you had to turn MARS "on" using the connection string. Any ideas why the reversal?

  • This is probably old news by now, but we have officially decided to turn MARS off by default for RTM based on customer feedback.



    Personally I am very glad that this is now an "opt in" property.

  • Angel,



    Thanks for the news. I was not aware of that.



    Wally

  • Okay so MARS is off by default - i.e. no change. WOOHOO :)

Comments have been disabled for this content.