結果 : replace cursor with while loop in sql server