Order By in View
In case of view Order By is supported or not ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Arjun PanwarPosted Nov 23, 2011, 10:50 PM
VulpesPosted Nov 23, 2011, 4:10 AM
Satyapriya NayakPosted Nov 23, 2011, 4:08 AM
ORDER BY clause is not supported in views .
Please refer the below link
http://blog.sqlauthority.com/2007/08/12/sql-server-fix-error-msg-1033-level-15-state-1-the-order-by-clause-is-invalid-in-views-inline-functions-derived-tables-subqueries-and-common-table-expressions-unless-top-or-for-xml-is-als/
http://stackoverflow.com/questions/1306359/order-by-in-a-sql-server-2008-view
Thanks
NarayanPosted Nov 23, 2011, 4:08 AM
CREATE VIEW [dbo].[View_1]
AS
SELECT TOP (100) PERCENT ID, Name
FROM dbo.Country
ORDER BY Name