Hi,
This may sound strange, but I see code that inserts data to a temporary table, which sources from the same temporary table. The code looks like this:
-- Some code that initially inserts data to #tmpA
IF(UserId = 0)
BEGIN
INSERT INTO #tmpA
SELECT * from #tmpA
END
I'm just curious on how this code snippets would do. Would this end up to an infinite loop? The whole code runs endlessly, I don't know if it's because of the CURSOR that is being implemented, or is it because of this code snippets which probably inserts data
to #tmpA endlessly?