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 Herb Caudill on 03/25/06 00:34

The problem is that the criteria for what subset to be return might be
simple or complicated - but at any rate it's not just a matter of
passing one or two parameters. For instance, in the past I might have
had:

view v_ArticlesBase -- in SS2000, provided ordered results
procedure GetAllArticlesByProgram(@ProgramID)
procedure GetRecentArticlesByProgram(@ProgramID)
procedure GetArticlesByArticle(@ArticleID) -- related articles
procedure GetArticlesByProject(@ProjectID)

... and so on. At the very least, the ordering logic needs to be
repeated in each of these stored procedures.

An alternative would be to create a single monstrous procedure that
consolidates the ordering logic but that uses a lot of conditional paths
to provide all of the subsets listed above - but that seems really
inelegant. Some of these are doing simple matches, while others are
having to traverse one or two linked tables to determine if an article
should be included in the subset.



*** Sent via Developersdex http://www.developersdex.com ***

 

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

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