Create a view with ORDER BY clause

in sql •  4 years ago 

Msg 1033, Level 15, State 1, Procedure xxxx , Line 105 [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.

As the error message suggested use

SELECT TOP 9999999 "fromYourQuery" ORDER BY something

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!