• wmbc - Thursday, March 23, 2017 12:12 PM

    I'm trying to sequentially get the row of id's from TableB.id into TableA.tableid from row 1 to row 4512

    TableB
     id
      123
      456

    end results to look like:
    TableA
     tablebid
     123
      456

    Use ROW_NUMBER() to number the rows in table b in a CTE, then join to table a - either on table a id, or on a ROW_NUMBER over table a.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]