• tshad (8/1/2014)


    That worked fine.

    Not sure what this means:

    ROW_NUMBER() OVER (ORDER BY (SELECT NULL))

    How does that work?

    This adds an incremental number to the output, by stating (SELECT NULL), one indicates that the order is not implied by any values but only the order of appearance. So for each row returned, the id value will be the MAX(KEY) (static throughout the batch) + the incremental row number.

    😎