String Concatenation Problem

  • Hi All,

    I have stored procedure where i am building an xml by Concatenating the string

    at different levels and at last converting string into xml.

    Problem here is in the process of Concatenation it taking more time and performing poorly.

    The length of string is around 4 lakh characters.

    Please suggest the solution.

    Regards,

    Ningaraju

  • Post some code, otherwise I highly doubt you will get any help.

    See the first article linked in my signature line if in doubt.

    -- Gianluca Sartori

  • Code is not much complex just concatenating the big string thats it.

  • ningaraju.n (1/24/2012)


    Hi All,

    I have stored procedure where i am building an xml by Concatenating the string

    at different levels and at last converting string into xml.

    Problem here is in the process of Concatenation it taking more time and performing poorly.

    The length of string is around 4 lakh characters.

    Please suggest the solution.

    400,000 characters is quite a long string, but why it is slow is probably down to the method you are using to concatenate. The slow approach I normally see involves concatenation a short new section many times, which involves a lot of copying. It is often possible to speed things up quite dramatically, but without knowing which method you are currently using, it is hard to be specific.

  • ningaraju.n (1/26/2012)


    Code is not much complex just concatenating the big string thats it.

    Just post a very small section of code that shows your technique. Are you using a WHILE loop? Concatenating into a column or a variable? Many questions will be answered by posting a short example, and you will get a good answer faster.

Viewing 5 posts - 1 through 4 (of 4 total)

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