tinausa - Wednesday, June 28, 2017 2:47 PM
With an ORDER BY clause. Doesn't have to be a straight order by name. You can have an expression in the ORDER BY, or add another column to the temp table with the required order, but that's how you force an order.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability