You are here: Top and Views « MsSQL Server « IT news, forums, messages
Top and Views

Posted by bozzzza@lycos.co.uk on 09/11/06 10:20

Hi all,

We have a big table connected to a web server, and I want the number of
rows to be limited that get returned.

So I could do something like this:

select top 10 *
from object
order by code

I then realised looking at the help file, because the "order by" clause
is set the SQL Server has to build the complete dataset, do the order
by and then filter it to the first ten rows.

So I was wondering if I put the query into a view like so :

create view vw_object as
select top 10 *
from object

Then ran the query like so:

select *
from vw_object
order by code

would the SQL server just get the top 10 rows from the view first, then
apply other order by on it afterwards?

 

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

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