bulk statements

May 17, 2012 at 2:37 PM
Edited May 17, 2012 at 2:40 PM

I have a legacy project. A lots of calls  (thousands) are made to the database
during a single request to the appserver.
Is any possibility to make only one call (bulk statements) to the db with FluentData
something like:
begin
insert into table1 ....
insert into table2 ...
update table1 .....
update table2 .....
delete from table3 ...
end;

Is any possibility to push those statements into a queue and execute all ?

Coordinator
May 17, 2012 at 4:55 PM

What database do you use? If you use SQL Server then you can execute everything inside a single call to the database:


context.Sql("insert into table1;")
.Sql("insert into table2;")
.Sql("insert into table3;")
.Sql("delete from table3;")
.Execute(); 

The ';' is used to separate each statement and the SQL method appends everything into a single string that is executed once. It might be a limit on the SQL length but I can't remember that now...

Did this help?

May 18, 2012 at 7:02 AM

It's ok. Thank you!