Does anyone know of any disadvantages of MARS (Multiple Active Result Sets)? Does anyone know of any reason why one should avoid using MARS, like cases where cursors are more useful then MARS.
相关问题
- keeping one connection to DB or opening closing pe
- Quickest method for matching nested XML data again
- What are IN and OUT parameter in SQL Server
- How to migrate a database from SQL Server 2005 to
- Cannot insert NULL values into column 'USERNAM
相关文章
- Convert column to string in SQL Select
- Why not “Invalid column name XYZ” error in subquer
- Create @TableVariable based on an existing databas
- Convert bit type to Yes or No by query Sql Server
- Linq-To-Sql and MARS woes - A severe error occurre
- Best Isolation Level to avoid deadlocks using an U
- How can i use pivot?
- Update and insert to one table from another
There are apparently at least two known (potential) drawbacks (from this (1) Team blog):
Obviously this can cause potential problems for any legacy systems which weren't designed to run against a MARS enabled design - "existing code optimized to run in the non-MARS world may show a slight performance dip when run un-modified with MARS"
“With MARS you can send multiple multi-statement batches to the server. The server will interleave execution of such batches, which means that if the batches change server state via SET or USE statements, for example, or use TSQL transaction management statements (BEGIN TRAN, COMMIT, ROLLBACK), both you and the server can get confused about what your actual intent is.”
I've yet to try out a MARS enabled design, but I'm coming very close to doing so on my current project. We have a slight issue with competing (and sometimes dependent) query operations (like lazy loading configuration data out of the same database that an active recordset is executing).
There's more information on the MSDN site (2) here
[ (1) http://blogs.msdn.com/sqlnativeclient/archive/2006/09/27/774290.aspx ]
[ (2) http://msdn.microsoft.com/en-us/library/ms131686.aspx ]
depending on what? there are no real disadvantages.
they don't support Transaction savepoints. but i don't think of this as a disadvantage.