title: SQLCommand ExecuteNonQuery Maximum CommandText Length?
body: <p>I've searched around the internet and everything seems to be about individual fields or doing one insert. I have a migration tool that is migrating from an old legacy database (superbase) to our SQL server DB (2008). Currently I'm reading 20,000 records from the old database and generating one big <code>SQLCommand.CommandText</code> string with 20,000 insert statements delimited by a semicolon. <strong>This works fine</strong>. But can I do 25k? 30k? I tried not having any limit at all, but when I tried to run <code>ExecuteNonQuery</code> with a <code>CommandText</code> containing over 4 million INSERT statements, it said something about being too long. I don't recall the exact error message, sorry. I can't find any documentation on the exact limitations. It's important for me to find out because the more inserts I can fire at a time, the faster the whole process. Any advice / links / documentation would be greatly appreciated, thanks!</p>