Check out this article over at SQL Team about SQL Server Cursors. Well, its actually about dynamically calculating a running total of a query. But it helps on Cursors.