Declare @branch_id as varchar (100), @ branch_desc as varchar (100)
Declare @CU_OBJ CURSOR SET @cu_obj = CURSOR LOCAL SCROLL for
SELECT BRANCH_ID, BRANCH_DESC from SMS_BRANCH
Open @cu_obj fetch next from @cu_obj @ Branch_id, @ branch_desc
While @@ fetch_status = 0 Begin
Fetch next from @cu_obj @branch_id, @BRANCH_DESC SELECT @ branch_id, @ branch_desc end
Close @cu_obj