Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loop through a result set
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01116848
Message ID:
01117072
Views:
16
>>Take a look at Re: How to derive the result set using SQL Statement Message #920889 and Re: String search in all tables?? Message #1065665 for an alternative.
>
>Thanks Sergey. Is it more overhead to use a temp table than a cursor? When would you create a temp table instead of declaring a cursor?

You have a choice between a table varable and a temp table. I would use a table variable unless I have to use a temp table. I prefer it over cursors because it provides more flexibility:
  • I don't have to worry what kind of cursor to create
  • I can run selects agains temp table or update it if necessary
  • There's no limitaion on how to move between records. They can be processed in any order you can imagine.
    --sb--
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform