Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Cursor Clarification

$
0
0
Hi allI have a query which has data injected into it, which is returned from a user defined function. This is very slow and I'm looking for a way to speed it up.The suggestion I'm working with is to have the data, retuned by the function, prepopulated into a temporary table using a FAST_FORWARD cursor.Having not worked with cursors before I headed to google to find out more and was almost immediately swamped with posts saying "dont use cursors" - "stay away from cursors" - "cursors were designed by the devil to do nasty things to your SQL from behind" etc etc.Can anyone explain to me whyI shouldn't use this cursor to prepopulate my temp table?I was under the impression that it would much quicker and more efficient than an equivalent while loop. Have I got this backwards?Thanks in advance

Viewing all articles
Browse latest Browse all 3145

Trending Articles