You may receive an error when creating a View with a SQL query. The ORDER BY Clause is invalid in views.
Issue Details
You must use the TOP Clause when creating a SQL Query in SSMS View. When using the ORDER BY Clause, if not, you will receive the following error.
Msg 1033, Level 15, State 1, Procedure Header Sales, Line 3 [Batch Start Line 0] The ORDER BY Clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
Recreate Issue
You will receive this error when creating a new VIEW using the following code.