Revert back to one query per insert

The giant query causes a stackoverflow exception on windows.