in reply to Batch DB query -- implementation?

Like perrin I very much doubt that batching your requests is really going to improve things for the MS-SQL side of things.

You are using placeholders, which with MS-SQL means that only the data for each parameter is actually sent for each execute. The number of replies from the database server will always be the same whether you send a bunch of inserts as a single buffer or not as at the protocol level you'll get one reply for each inserted row.

For MySql the situation may be a little bit different as I believe that DBD::MySQL emulates placeholders (that is it does the equivalent of interpolating the values in the SQL string before sending it to the server for each row).
But I don't really know MySQL - so I don't know if there is a way around that.

Finally - when you say that DBD::MySQL dies on multiple statements separated by ';' then that is perfectly normal. What you have to realize is that SQL clients that use the ; character to separate SQL commands in reality send each command to the server separately, essentially doing something like

@cmds = split(/;/, $sql); # yes I know - that regexp won't do the ri +ght thing! foreach (@cmds) { $sth = $dbh->prepare($_); $sth->execute; etc... }

Hopefully this little explanation will help :-)

Michael