Home Forums Article Discussions Article Discussions by Author Discuss content posted by Ian Stirk Spring Clean Your Database Schema RE: Spring Clean Your Database Schema
richardd
Hall of Fame
Points: 3963
More actions
January 19, 2009 at 6:08 am
#929157
Since this only works in SQL 2005 (due to the "OVER" clause on the "COUNT(*)" statement), you could replace the temporary table with a CTE.
Alternatively, for SQL 2000, you could use a nested query, and order by "COUNT(COLUMN_NAME) DESC" instead.