• subscribe
June 20, 2001 12:00 AM

Tip: Using ORDER BY in a View or Derived Table

SQL Server Pro
InstantDoc ID #21361
Downloads
21361.zip

T-SQL syntax doesn't support an ORDER BY clause in a view or a derived table unless you also include the TOP keyword as part of the SELECT statement. SQL Server 2000's error message hints at this fact by suggesting that the TOP keyword will help, as the example in Figure A shows. But you can circumvent this restriction by including a TOP 100 PERCENT clause, as the example in Listing A shows.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...