Preserving ORDER BY in SELECT INTO
I have a T-SQL query that takes data from one table and copies it into a new table but only rows meeting a certain condition: SELECT VibeFGEvents.* INTO VibeFGEventsAfterStudyStart FROM VibeFGEvents LEFT OUTER JOIN VibeFGEventsStudyStart ON CHARINDEX(REPLACE(REPLACE(REPLACE(logName, 'MyVibe ', ''), ' new laptop', ''), ' old laptop', ''), excelFilename) > 0 AND VibeFGEventsStudyStart.MIN_TitleInstID <= VibeFGEvents.TitleInstID AND VibeFGEventsStudyStart.MIN_WinInstId <= VibeFGEvents.WndInstID WHERE VibeFGEventsStudyStart.excelFilename IS NOT NULL ORDER BY VibeFGEvents.id The code using the