.comment-link {margin-left:.6em;}

Wednesday, February 22, 2006


I Already Have MARS in SQL 2000

Can we really have Mars in SQL 2000 ? The answer is yes to some limit

pIDBCreateCommand->CreateCommand(NULL, IID_ICommandText, (IUnknown**)
pIDBCreateCommand->CreateCommand(NULL, IID_ICommandText, (IUnknown**)
OLESTR("select operation_id, operation_code, product_id, quantity
from dbo.operations where processed=0"));
pICommandText2->SetCommandText(DBGUID_DBSQL,OLESTR("update dbo.operations
set processed=1 where operation_id=?"));
//Execute the command
pICommandText->Execute(NULL, IID_IRowset, NULL, &cRowsAffected, (IUnknown**)
//Execute the command 2
pICommandText2->Execute(NULL, IID_IRowset, NULL, &cRowsAffected, NULL);

What does SQLOLEDB does in the background ? It opens a new connection . What
? Yes you heard me . It opens a new connection and execute command2

Some Scenarios :
1- what happens if command1 was in a DTC TX ?
in this case SQLOLEDB cannot open a new connection and command2
2-Command1 in a TSQL TX not a DTC TX ?
SQLOLEDB has no idea that command1 is in a TX and it will open a new
one, ending in two command living in different TX.
3- think about more scenarios like locking (2 commands lock each other )
There are a lot of more scenarios to be covered but no time

Any way , again the answer of the question is YES of course we do support
MARS in SQL 2000 behind the scene

You have a very good blog that the main thing a lot of interesting and useful! erectile dysfunction Read a useful article about tramadol tramadol
Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?