My ortho gave me ambien after my knee surgery. Didn't do much for me. I have some samples of ambien cr that my pain doc gave me...but I've only taken one. They don't do much for putting me to sleep, but the next day, I'm groggy as hell. I also have Lunesta, and that doesn't do much either, but it leaves such a horrible metallic taste that IMO, it's just not worth taking. (unpleasant metallic taste is a known side effect)
It's extremely rare for me to sleep through the night. MOST nights, I sleep 3-4 hours, then the pain wakes me up...so I get up and move around for a while. Then, I go back to bed for another couple of hours.
Sleeping "in shifts" sucks.