Viewing 3 posts - 1 through 3 (of 3 total)
For extra credit, here is the MERGE:
MERGE @Table T
USING (SELECT 5 AS col1, 1000 AS col2) AS V
ON T.col1 = V.col1
WHEN NOT MATCHED
THEN INSERT (col2)...
November 26, 2014 at 2:31 am
#1761009
Nice question!
I was surprised that the final RAND() also returns a constant value after a previous call with a seed. It's in the Remarks in BOL, so I guess it's...
October 23, 2014 at 4:09 am
#1754273
The result is undefined without an ORDER BY in the main query. Most likely the results will be sequential by ID.
October 13, 2014 at 6:20 am
#1751962