• Selecting into a temp table first is not a solution. When your cursor selects the data back out of the temp table, there's no guarantee it will be in the same order. Sort Order when SELECT FROM Table Variables Unless that's untrue, you should take that suggestion down since many may not read past it.