Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very lengthy stored procedure status

I have a stored procedure which takes about 5-8 mins to execute. The user just sees a message "Please wait while report is being generated" It is very likely that people may think that it has stopped working ... or something went wrong.. etc..

Is there any way a stored procedure can keep returning status while executing..?

for example :

{logical block 1}
logical block 1 completed!
{logical block 2}
logical block 2 completed!
{logical block 3}
logical block 3 completed!

If yes, Please also tell me me how do I catch those status in c#.

Thanks guys.

like image 687
Bilal Fazlani Avatar asked Mar 16 '13 04:03

Bilal Fazlani


Video Answer


1 Answers

You can use the InfoMessage event to receive PRINT and RAISERROR messages on the client.

If that doesn't work, I'm afraid you'd have to split your stored procedure up into multiple smaller procedures to get the status at each step.

like image 161
p.s.w.g Avatar answered Oct 02 '22 15:10

p.s.w.g