How to use Cursor in Sql - CodeProject