ORDER BY clause in View

  • Hi All,

     

    I have a small doubt.

     

    Is there any special reason why we can’t use ORDER BY clause in View definition without using the TOP clause?

     

    Regards,

    Ramesh K

  • Im pretty sure that it is due to the fact that the view (as a general rule) doesn't retain the data and has to go get it everytime a request is made.  With that said you can do SELECT TOP 100 PERCENT and that will give you ALL the data.

    I think it is just a sanity check by the SQL teams to ensure that the data pulled back will be in the proper order for what you want by making you explicitly state how much data do you want and THEN sort it.

    Again, I could be completely wrong it just makes sense to me this way



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply