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
标签:Cursor,exists,游标,SERVER,cursor,PRINT,open From: https://www.cnblogs.com/watermarks/p/17275887.html