How to avoid Cursor in SQL Function

  • Hi,

    I have created a function in which i want the result as comma separated like A,B,C

    For that I had to combine the records which were there in different Rows

    so for wach record in table, function is getting executed and it is fetching the data from the other details table, is there a way so i can have the Result like A,B,C and also i can avoid the cursor..!?

    Thanks

    Parth

  • You don't really need a c.u.r.s.o.r nor a function.

    What you most probably can do: use FOR XML PATH('').

    We'd be able to show you how it works but we don't have any sample data to play with.

    So, all can provide is a link to a different post.

    If you'd like to see a coded version using your data please read and follow the first link in my signature.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply