Forum Discussion
mrloganathan
Jan 31, 2025Copper Contributor
SQL Query is taking long time when using WHILE inside another WHILE loop. Please help
WHILE @LineDircurrent <= @LineDirCount BEGIN Create Table ##TempLinePatternSequence( [Id] int identity(1,1) not null, [SignId] uniqueidentifier NULL, [LineDirId] uniqueidentifier NULL, ...
olafhelper
Feb 03, 2025Bronze Contributor
SQL Query is taking long time when using WHILE inside another WHILE loop. Please help
Help on what? You haven't posted any usefull information?
The only suggestion I can give is: Stop working with iterations = WHILE loop.
Do what SQL Server can do best: Work set-based = real SQL solution.