Home Forums SQL Server 7,2000 Strategies A Case For Concatenation (Building Delimited Strings ) In T-SQL RE: A Case For Concatenation (Building Delimited Strings ) In T-SQL

  • Jack, I can see that it would be considered advanced. I never heard about using FOR XML this way until the last couple of months. But having seen it once, the technique is elegantly simple. It is much more intuitive than using a tally table to parse strings.

    I deliberately sidestepped the issue of other peoples' skills as a consideration in "doing it where it makes sense". Skill levels vary from organization to organization, and for some people, it would take the hours of time to get it right in the UI. You write code on both sides, so you can do it wherever it is easiest for you. So again the answer becomes "it depends".

    Again, this is just me trying to understand what other considerations should influence the choice. When people I respect say not to do something, it's wise to listen; but it's also important to understand the "why" behind the general rule. The first post contains a number of examples where indisputably the UI should handle string manipulation. But in the case of building delimited strings out of column values for multiple rows, SQL still looks like the better choice.

    Thanks for the input.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills