Reputation: 405
I have problem in stored procedure. The stored procedure produces Cursor output. The SQL query which produces the output execute in less than 1 Sec.But procedure takes more than 10 Minutes to execute.Stored procedure doesnot have any other quires.
Upvotes: 0
Views: 2199
Reputation: 81882
A common reason for such behavior is to confuse the time to return the first (couple of) row(s) with the time needed for all the rows. If you just issue a select in most sql tools you get the first rows as soon as they are available. This does not mean the sql statement is completely processed. Only if you scroll down to the last row the sql processing is finished.
Upvotes: 2