Hi All
Even though the use of cursors is not popular I would like to query a multi level structure. The level count will define how many cursors I will need.
If I replace STR(@CNT) with for example C1 this works fine.
DECLARE @CNT INT
DECLARE @LVL INT
SET @LVL = 3
SET @CNT = 1
WHILE (@CNT <= @LVL)
BEGIN
DECLARE STR(@CNT) CURSOR FOR
SELECT BID FROM TBLREL
DEALLOCATE STR(@CNT)
SET @CNT = (@CNT + 1)
END
Ignore the select statement as this probably seems pointless.
Thanks in advance
Even though the use of cursors is not popular I would like to query a multi level structure. The level count will define how many cursors I will need.
If I replace STR(@CNT) with for example C1 this works fine.
DECLARE @CNT INT
DECLARE @LVL INT
SET @LVL = 3
SET @CNT = 1
WHILE (@CNT <= @LVL)
BEGIN
DECLARE STR(@CNT) CURSOR FOR
SELECT BID FROM TBLREL
DEALLOCATE STR(@CNT)
SET @CNT = (@CNT + 1)
END
Ignore the select statement as this probably seems pointless.
Thanks in advance