1. Performance Tuning SQL Server Cursors
http://www.sql-server-performance.com/2007/cursors/
2.Server Side Cursors and ADO Cursor Types
http://www.sqlteam.com/article/server-side-cursors-and-ado-cursor-types
3. OffSet
4.pivot table : dynamic table.
5. substring function in sql to compare the text data.