SQL SERVER - 如何检测游标cursor是否打开?

 

IF CURSOR_STATUS('global', 'mycursor') >= 0
BEGIN
PRINT 'Cursor exists and is open';
END
ELSE
BEGIN
PRINT 'Cursor does not exist or is not open';
END;

 

 

 

 

REF:https://stacktuts.com/how-to-check-if-cursor-exists-open-status-in-sql

posted @ 2023-03-31 12:09  po-A  阅读(81)  评论(0编辑  收藏  举报

Tushare大数据开放社区-免费提供各类金融数据和区块链数据 , 助力智能投资与创新型投资。

Python, Matlab, R, Web数据抽取学习交流。