Reputation: 51
I have to generate a big report consists of 45 insert statements. How can I Run more than one insert statement at a time it by splitting the queries into groups.
Upvotes: 1
Views: 1651
Reputation: 4622
You might succeed in running multiple sessions (i.e. logins).[EDIT] I wrote, that an insert locks the table, which is wrong. Thanks @marc_s. [/EDIT]
However, if your insert
precedes a complex query, you might be successful, as the queries could be carried out in parallel.
But, it greatly depends on the code.
Isn't there anything you can improve using the existing code? Usually, there is enough room for a performance boost just by looking at the statements.
Upvotes: 0
Reputation: 473
Try using multiple stored procedures where each stored procedure handles several insert statement. Even if you execute these procedures one by one they should be executed in parallel on SQL server as long as you’re using different connections.
Upvotes: 0
Reputation: 21
USe Stored Procedure for that and by using it u can return value also.
Upvotes: 1