http://pubs.acs.org/cen/coverstory/85/8536cover5.html

Sleep Anchors Memory
Aided by dramatic swings in neurochemicals, different stages of sleep help preserve different types of memory
Sophie L. Rovner

You'll never again take sleep for granted once you talk to Matthew P. Walker, a psychologist at Harvard Medical School's sleep and neuroimaging lab. "Sleep plays an important role in processing memories," he declares.

Say you're taking piano lessons and you learn how to play a scale. The next day, you'll find that "sleep has enhanced the information that you learned, so you're 20-40% better in performing those motor skills than you were the day before," Walker says. "Your brain has continued to learn in the absence of any further practice, which is quite magical."

The window of time for that improvement is limited, however. If you're a college student and you pull an all-nighter after the piano lesson, you lose out on the memory enhancement permanently, even if you sleep the next night, Walker says. "It's not practice that makes perfect," he says, "but it's practice with a night of sleep that seems to make perfect. If you don't snooze, you lose."
Interesting but the hypothesis seems to be a bit on the extreme side to me. Personal experience tells me that I don't get retrograde amnesia of things that day before I pull an all nighter. If so, half of the interns who were on every other night call would not have been able to remember their actions and patients every other night. I don't buy that. There must be memory consolidation going on while one is awake.

Wise.