Hi chcw,
>>So I want to improve the performance.
I recommend using stored procedures which create table, because stored procedures can reduce network usage among clients and servers – stored procedures perform intermediate processing
on the database server reducing unnecessary data transfer across the network. And stored procedures are tunable to improve the performance. if same stored procedure executed, it will use the previously cached execution plans. In addition, you could try
to create a temp table, and put the data into temp table, and then you could use insert into select from temp table instead of insert the date into table one after another.
>>Whether Execute method can be invoked asynchronously? If yes, then after I invoke the Execute method to submit the SQL query to SQL Server engine, before the query is executed
completed, the Execute method can return and I can run other parts of the program, which will save a lot of time.
You could invoke asynchronous execute method, and the following link for your reference.
https://msdn.microsoft.com/en-us/library/ms681467(VS.85).aspx
>>Another solution is to merge several SQL statements together and submit them together with one invoke of Execute method. But I make a test of such a solution and find the time
consumed will be longer than Executing one statement at a time. So it seems this solution is also not feasible?
You could try to use stored procedures.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.