locked
Setting up SQL 2005 Express RRS feed

  • Question

  • It must be that i'm new to SQL, but i've tried upgrading to SQL 2005 but my views doesnt work?
    I cant even make a new view that makes a decending sort - It doesnt sort?

    Can anyone tell me what have changed since SQL 2000?

    /MQH
    Monday, December 5, 2005 10:06 PM

Answers

  • I have filed a bug for "Open View" not sorting the results. 

    I am not sure why your ASP app would not sort based on the view defination.  Try tracing the server to determine the query your ASP app is issuing against the server.

    Peter
    Tuesday, December 6, 2005 7:34 PM
  • Views do not automatically sort, unless you do something like I specified above. Your application is responsible for specifying the sort order.  Use Profiler to determine if your application is specifying an ORDER BY clause. If you are specifying an ORDER BY clause, please provide the table schema and query.

    Peter 

    Monday, January 9, 2006 8:30 PM

All replies

  • What specifically are you trying to do?  In SQL Server 2000 & 2005, you can not normally have an ORDER BY in a view, unless you do something like the following:

    create view v1 as
    select top 100 percent * from dbo.Table_1
    order by col1

    Peter

    Tuesday, December 6, 2005 4:04 AM
  • I have done it just like you wrote - Just like i SQL 2000 - The differece is when i "modify" my view and "execute SQL" in SQL 2005 it is woorking fine - But when i "open" my view the sort funktion i gone???? - The problem is when i acces the SQL DB fra my ASP pages it is the "open" view i get, with no sort what so ever!!!

    It must be at setting - Can you try it and tell me that I'm the only one with this problem. 

    /MQH
    Tuesday, December 6, 2005 7:08 PM
  • I have filed a bug for "Open View" not sorting the results. 

    I am not sure why your ASP app would not sort based on the view defination.  Try tracing the server to determine the query your ASP app is issuing against the server.

    Peter
    Tuesday, December 6, 2005 7:34 PM
  • I am running into the same issue.  ASP.NET 1.1 application, SQL 2005 (standard not express) views are not sorted when returned.  They sort fine in the management studio.  I've not tested much but it seems to happen when I'm sorting on a calcualted field.
    Monday, January 9, 2006 8:23 PM
  • Views do not automatically sort, unless you do something like I specified above. Your application is responsible for specifying the sort order.  Use Profiler to determine if your application is specifying an ORDER BY clause. If you are specifying an ORDER BY clause, please provide the table schema and query.

    Peter 

    Monday, January 9, 2006 8:30 PM
  • Yep, Order By is not working for Views. It's definitely a bug.
    Sunday, February 19, 2006 3:46 AM