keep a counter, and execute the SQL string after every 10 or so, then clear the string and start over