title: Computed column that uses row_number() or dense_rank() over a partition
body: <p>This question is related to a previous question, 
  <a href="https://stackoverflow.com/questions/16660169/grouping-by-or-iterating-through-partitions-in-sql">Grouping by or iterating through partitions in SQL</a></p>
  
  <p>I need to support SQL Server 2005, 2008, 2008 R2, and cannot depend on the Enterprise or full version (must work in SQL Server Express). </p>
  
  <p>What I am trying to do is create a user-defined <strong>computed</strong> column that is essentially either a <code>row_number()</code> or <code>dense_rank()</code> over a partition by clause. This needs to act like an index, in that whenever rows are added to the table, this user-defined column is automatically generated. </p>
  
  <p>I looked over the following Microsoft link that explains how to create a column based on a function, <a href="http://msdn.microsoft.com/en-us/library/ms186755.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms186755.aspx</a>. It doesn't quite get there. </p>
  
  <p>It may not be possible, especially without the full version of SQL Server. Any thoughts? </p>