No matter what, I can’t batch MySQL INSERT statements in Hibernate

It’s likely your queries are being rewritten but you wouldn’t know if by looking at the Hibernate SQL logs. Hibernate does not rewrite the insert statements – the MySQL driver rewrites them. In other words, Hibernate will send multiple insert statements to the driver, and then the driver will rewrite them. So the Hibernate logs … Read more

Run all SQL files in a directory

Create a .BAT file with the following command: for %%G in (*.sql) do sqlcmd /S servername /d databaseName -E -i”%%G” pause If you need to provide username and passsword for %%G in (*.sql) do sqlcmd /S servername /d databaseName -U username -P password -i”%%G” Note that the “-E” is not needed when user/password is provided … Read more

Batch update/delete EF5

There are two open source projects allowing this: EntityFramework.Extended and Entity Framework Extensions. You can also check discussion about bulk updates on EF’s codeplex site. Inserting 100k records through EF is in the first place wrong application architecture. You should choose different lightweight technology for data imports. Even EF’s internal operation with such big record … Read more