Zack
asked on
Alternatives to Cursor function in SQL Script
Hi EE,
For the following script see attached is there a method of implementing this that doesn't use the Cursor function.
Any assistance is appreciated.
Thank you.
Datadump.txt
For the following script see attached is there a method of implementing this that doesn't use the Cursor function.
Any assistance is appreciated.
Thank you.
Datadump.txt
ASKER
Hi HainKurt,
This question is more of a general inquiry for me as I have read multiple posts, saying you should avoid implementing queries that use cursors:
https://stackoverflow.com/questions/16711535/sql-server-avoiding-cursors
No actual issue with the script per say.
Thank you
This question is more of a general inquiry for me as I have read multiple posts, saying you should avoid implementing queries that use cursors:
https://stackoverflow.com/questions/16711535/sql-server-avoiding-cursors
No actual issue with the script per say.
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
but cursor is not nightmare, and here I see 5-10 maybe a couple of 100 records in the loop...
I dont see any big issue here... whats the problem with using cursor?
I dont see any big issue here... whats the problem with using cursor?
ASKER
Thank you that gives me something to review when I get a chance, much appreciated.
ASKER
Hi HainKurt,
For some reason, this Cursor function breaks on some our SQL servers I have got a feeling to got to do with the way the CLR is implemented, but I can't confirm.
Thank you.
For some reason, this Cursor function breaks on some our SQL servers I have got a feeling to got to do with the way the CLR is implemented, but I can't confirm.
Thank you.
if it fails with cursor, it will break with any other method as well...
this way, you can at least use try/except in the loop so you can control the process better...
if you can re-produce the issue, we can look at it later...
this way, you can at least use try/except in the loop so you can control the process better...
if you can re-produce the issue, we can look at it later...
Open in new window
to the end of script...
what is the exact issue here?
when I run it, it returns 4 resultset...