Quantcast
Channel: Recent Edits
Viewing all articles
Browse latest Browse all 12198

Sample using a UDF

$
0
0
' I have a hierarcal menu system with 5 levels Here is how I walk all 5 levels with NESTED SQL CURSORS without the global @@FETCH_STATUS messing up ' -- First make a UDF         CREATE FUNCTION FetchStatusOfCursorNamed(@CursorName nvarchar(50))         RETURNS int AS         BEGIN                 DECLARE @fetch_status int                 select @fetch_status = fetch_status from sys.dm_exec_cursors(@@SPID) where name = @CursorName                 RETURN @fetch_status         END -- th

Viewing all articles
Browse latest Browse all 12198

Trending Articles