Command object and batching stored procedure calls



Greetings,
I've tried searching online for what I think must be easy to do, but so far
no luck. I have to call a stored procedure over and over as data comes in.
I'd like to queue the calls up on the client side and send them in one batch
to avoid all the network traffic but I can't figure out how. Here's an
example of how I set up the command object:
cmd.CreateInstance(_uuidof(ADODB::Command));
cmd->CommandType = ADODB::adCmdStoredProc;
cmd->ActiveConnection = myConnection;
cmd->CommandText = _T("storedProcdureName");

ADODB::_ParameterPtr ADOPrm;
// create and add a bunch of parameters
ADOPrm = cmd->CreateParameter(...);
cmd->Parameters->Append(ADOPrm);
...
cmd->PutPrepared(VARIANT_TRUE);

So the Command object is saved and "prepared" and it uses a parameterized
form so we can keep calling it and save some performance that way. Now in
some other location that's "listening" for data we have code like this that
uses the cmd object:

// Data comes in so fill in the parameters like this and execute
cmd->Parameters->GetItem("@someItem")->Size = mySize;
cmd->Parameters->GetItem("@someItem")->Value = someValue;
...
cmd->Execute(....);

But this code could easily store up information and send over a giant batch
command of some sort every so often instead of sending over a call every
time. Could somebody please help me figure out how I could batch all these
calls into a single network transfer?

Many thanks in advance,
-Michael Viking


.