Using the cursor in OLTP databases (SQL server)

Can cursors be used in stored procedures called from a website? There is an obvious performance hit, but what I'm trying to pick up here is a problem with @@ Fetch_status variable. The @@ Fetch_status scope used in stored proc is a join. Is it not possible for two different users to invoke the same stored process from the same connection through the user interface? Won't it cause unexpected results?

In other words, will the fact that @@ Fetch_status is global, not only for the scope, but for the entire connection, cause any problems?

NOTE. This post is not about whether using the cursor is a good idea. I will be grateful for the answers related to @@ Fetch_status. Come here to discuss the pros and cons of cursors

+1
source share
1 answer

If you do not use global cursors, you must be safe.

who said why you use cursors, almost everything can be done on the basis of SQL Server, and it will be many times faster in almost any situation.

+2
source

All Articles