• Nice work. I'd miss out the first view though - unless it's going to be used elsewhere, it's simply clutter:

    SELECT RowID,

    MAX(CASE WHEN LineNumber = 1 THEN DelAddr ELSE '' END) as DelAddress1,

    MAX(CASE WHEN LineNumber = 2 THEN DelAddr ELSE '' END) as DelAddress2,

    MAX(CASE WHEN LineNumber = 3 THEN DelAddr ELSE '' END) as DelAddress3,

    MAX(CASE WHEN LineNumber = 4 THEN DelAddr ELSE '' END) as DelAddress4

    FROM (

    SELECT

    RowID,

    Address1 + ' ' + Address2 + ' ' (etc) as DelAddr,

    row_number() OVER (partition BY RowID ORDER BY RowID) AS LineNumber

    FROM MyTable

    ) d

    GROUP BY RowID

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden