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/24/06 22:39

>>> incompetent people ... ignorance ... amatuer or a hillbilly ...
dangerous moron ... clean up their crap ... This is how Ghod punishes
you for your bad code ... Satan ... etc. <<<

My goodness, Celko. Where is this anger coming from? A little out of
proportion to the subject matter, if you ask me. I'd genuinely like to
learn from you, since you obviously know more than I do, but the
bile-to-wisdom ratio of your posts makes it tempting to just ignore you.
That would be a shame, wouldn't it?

Here's a simple real-life situation; let's see if we can work together,
keep our blood pressure down, and come up with a solution that is both
practical and theoretically pure.

1. You have a SQL table containing website content.
2. 25 different parts of the website display 25 different subsets of
this content.
3. The content on every page should be sorted in exactly the same way.
The sorting logic is relatively complex and subject to change.

Here's how I might have handled this on SQL Server 2000:
1. Create a base view that incorporates the sorting logic: Select top
100 percent ... order by ... (the sound you hear is Celko calling down
divine wrath upon me and my children and my children's children)
2. Create 25 child views to return subsets of the base view.

Of course, now that I've been punished by the almighty for my crimes
against humanity, this is no longer an option. Some suggest moving the
sorting logic to the client - which would require the same exact "order
by" clause 25 places in my .NET code. This is unsatisfactory because I
have to maintain the same logic in 25 different places. Can we do
better?


*** 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

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