I have @temp that take 5 random rows from sp_get_Randomly. The sp_get_Randomly return top (5) of myTable and only select id to improve performance. This
5 rows are unsorted(in @temp). When I inner join it with MyTable, the result insert into #tempNew sortly. My problem is here: I want to #tempNew remain unsorted like @temp. How can I stop sorting there? I Know I can unsort it with “Order by newid()”
again. But is there anyway to keep same discipline of @temp in #tempNew, too?
View Complete Post