You are here: Re: ORDER BY in VIEW not working « MsSQL Server « IT news, forums, messages
Re: ORDER BY in VIEW not working

Posted by David Portas on 01/31/06 11:58

Beowulf wrote:

> Unfortunately, I have a large number of views that need to be joined
> with physical tables and other views. As far as I know (entirely
> possible I'm wrong), my options are views or user-defined functions that
> return tables.

Yes but in that case it would make no sense to use an "ordered" view
even if such a thing were possible. Forcing SQL Server to order the
data before you join it in a query might restrict the server from
utilizing a better query plan that implied a different ordering. This
is exactly why the optimizer is and should be free to ignore sorts in
views.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация