SQL Server??????μ??????????α?
???????????? ???????[ 2016/3/15 11:11:20 ] ????????????? ?α?
????????????SQL SERVER???α????????e??????????SQL Server??????α?????????λ????????μ???????????????????α??????е?????????????????£????????????
??????1??????????????ó????????????α?????????????α?
????DECLARE Cursor_Test CURSOR FOR
????SELECT * FROM dbo.TEST;
????OPEN Cursor_Test;
????????????????μ???????????????????α????SQL SERVER??????????????????sys.dm_exec_cursors?????????й????????????д????α???????
????SELECT * FROM sys.dm_exec_cursors(0)
??????????????????????????????ε?????????ο?MSDN???????????????????????????????й????α???????????is_open???й????????α???????????1?????0???????
??????2??????й????α?
SELECT session_id ??
cursor_id ??
name ??
creation_time ??
is_open
FROM sys.dm_exec_cursors(0)
WHERE is_open = 1;
clipboard
?????????????????????????????α????????1??й???α?????CLOSE Cursor_Test;?????????α??????????
??????????????????SQL??????????????????????1 С??????α?????????????????е????????????
SELECT creation_time
??cursor_id
??name
??c.session_id
??login_name
??c.creation_time
??c.is_open
FROM sys.dm_exec_cursors (0) AS c
JOIN sys.dm_exec_sessions AS s ON c.session_id = s.session_id
WHERE DATEDIFF(hh?? c.creation_time?? GETDATE()) > 1;
GO
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11