Hi everibody I am working with SQL Server Express. I have a view whose definition is something like this: SELECT ... FROM .. ORDER BY. If I am running the view (execute SQL) result is correct (orderly) but if I am opening the view, result it isn't (not orderly). Why ? What I have to do ? Thanks in advance
Looks you're experiencing something like this: http://support.microsoft.com/default.aspx?scid=kb;en-us;926292 Putting an ORDER BY clause inside a view definition has always been senseless. It is the SELECT statement which queries the view that requires the ORDER BY to enforce the guaranteed order. In SQL Server 2000 the ORDER BY from within the view was propagated to the outer SELECT, thus a statement like SELECT * FROM view appears to be sorted correctly. However, it was never guaranteed to, but just happens to be this way because of the implementation. In SQL Server 2005 this implementation has changed to follow the standard and now this is screwing up a lot of code.