how to use while loop to fetch record in sql server without using cursor...