Maximum number of inserts per transaction on SQL Server

2.2k Views Asked by At

Does anyone know how many INSERT commands per transaction SQL Server can handle at the same time? Basically, I'm building a long string with bunch of INSERT's (around 8000 INSERT commands, and each has around 600 characters) which then I will execute using a function SQLexcute(sql_text):

for(obj in objects) {
    sql_text += "INSERT(prop1, prop2, prop3, prop4, prop5) VALUES(" + obj.prop1 + "," + obj.prop2 + "," + obj.prop3 + "," + obj.prop4 + "," + obj.prop5+");"
}
SQLexcute(sql_text)
1

There are 1 best solutions below

1
On

Sean is right.

Do not execute the code in mosel. You have to create your query in T-SQL and pass the parameters there.

Here you have the link for table valued param:

Tabled valued param