Lists

  • Jeff Moden (12/28/2014)


    The link for the "poor documentation" that I was speaking of is actually in Books Online under UPDATE... as in "Quirky Update", which can be controlled but is absolutely not supported. Let's not go there, though. 😀

    I see the similarities between quirky update and aggregate concatenation queries from an "intenedced effect" point of view, but frmo a technical point of view, they are totally different. I don't think it's safe to assume that documentation for the one applies to the other.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (12/28/2014)


    Jeff Moden (12/28/2014)


    The link for the "poor documentation" that I was speaking of is actually in Books Online under UPDATE... as in "Quirky Update", which can be controlled but is absolutely not supported. Let's not go there, though. 😀

    I see the similarities between quirky update and aggregate concatenation queries from an "intenedced effect" point of view, but frmo a technical point of view, they are totally different. I don't think it's safe to assume that documentation for the one applies to the other.

    That would be part of the reason why I have so much fun at all of this. I don't assume but I do see the similarities and the possible workarounds.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
    "Change is inevitable... change for the better is not".

    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)
    Intro to Tally Tables and Functions

  • Very simple question. i got 1 :w00t:

    Manik
    You cannot get to the top by sitting on your bottom.

  • DrKiller (12/23/2014)


    wow what a complex way of doing it.

    I'm usually just doing this 🙂

    DECLARE @tmpString VARCHAR(MAX)

    SELECT @tmpString = COALESCE(@tmpString + ', ' + productname, productname) FROM Header

    SELECT @tmpString

    Six years ago I was using this technique against an ERP POS that shall remain nameless: rather than use a memo field they had a table that chunked comments in to 50 character pieces and I used this technique to piece it back together through a function. In my case, I was selecting a very small number of records out of a large table, so hopefully it was doing RBAR on a small subset. We never had any performance problems in that install.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • This technique works well enough, I've used this in production code against SQL 2008 R2. However, not sure if this works in 2005 or prior versions.

    Andre Ranieri

    @sqlinseattle

Viewing 5 posts - 31 through 34 (of 34 total)

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