Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


January 17, 2006

New SQL Server 2005 Functions Rank High


RSS
View this exclusive article with VIP access -- click here to join |
See More T-SQL Articles Here | Reprints | Or sign up for our VIP Monthly Pass!
Main Article    Rem

I'm writing a Web-based application that will retrieve data from a Microsoft SQL Server 2005 database. The application includes a simple report that provides the total annual sales per district, according to the year that the user enters. I want to rank the data by sales amount as the application retrieves the rows. For example, if the Southwest district has the most sales for a particular year, I want that district to be ranked number one and appear in the first row returned from the database. How do I include in a SQL Server stored procedure the logic necessary to support this functionality?

You're in luck! SQL Server 2005 includes a set of functions that analyze and rank values returned by a query. What takes several lines of code to achieve in earlier SQL Server versions can now be condensed into a single function and its arguments. Simply include the function as a column definition in the SELECT clause of your query, and SQL Server analyzes the specified values and automatically assigns a ranking value to each row, based on that analysis. . . .

Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

How can I stop and start services from the command line?

...

Where is Microsoft NetMeeting in Windows XP?

...


Related Events Storage Consolidation for Your Microsoft Applications: Reducing Cost and Complexity

SQL Server 2008 – Can You Wait? | Philadelphia

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing