Critical Status - Database-Oriented Issues Plus

It seems that everything has a critical status, especially when it comes to databases and software development! Here's a place for listing issues and ideas relating to database and development issues. I'll list problems and ideas mainly related to SQL Server 2005. Post your thoughts, advice or complaints! Later this year will be the 25th anniversary of being in the trenches of the IT industry. I specialize in database applications development. I'd like to share my experiences with everyone and learn of those of others. You never stop learning.

Wednesday, May 7, 2008

ORDER BY CLAUSE IN A VIEW

I FOUND THIS ONE INTERESTING. IN CREATING A VIEW IN 2005, YOU CAN USE AN ORDER BY CLAUSE WITHOUT A TOP OR FOR XML. I DON'T REMEMBER THIS BEING THE CASE IN 2000 OR BEFORE.

Msg 1033, Level 15, State 1, Procedure vwTESTING_ORDER_BY, Line 30
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified
.

No comments: