If a stored procedure is altered while it's currently being used in a cursor, does the cursor continue using the old query before it was altered?

dba.stackexchange https://dba.stackexchange.com/questions/253328

Вопрос

If a stored procedure (or view) is currently in use within a long running cursor, and I alter that stored procedure, will the cursor continue using the old instance of the stored procedure until the cursor is finished?

Это было полезно?

Решение

So per @LowlyDBA's suggestion I decided to test this for myself (to a degree). I was actually in the middle of debugging a hot production issue so couldn't really stop to write out the code for a test case. But the code I'm debugging is this scenario. So I made my update to the procedure and looked at the running queries and saw the query text changed from before and after my change to the procedure as the cursor continued to iterate.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с dba.stackexchange
scroll top