*(adding this)
Jennifer below, made a suggestion of liquid calcium... its actually liquid magnesium (or with calcium) which helps people or kids to sleep... it basically just calms and helps one to release stress. Many benefits of it. For kids though, you need to get the Kids version.... the brand "Animal Parade" makes it too, for kids. The reason it is in 'liquid/powder' form is that it is absorbed better than if from a pill.
I take the magnesium myself sometimes when I am stressed and can't sleep or for PMS... it does help, a lot. Try the "Natural Kids Calm - 8 oz - Powder" which you can even get from Amazon... or any natural food store. This is the brand I have. If you go to www.amazon.com, you can read the reviews about it there.
Magnesium is water soluable and safe and very beneficial in many ways, if you look it up online.
--------------------------
Okay, it's not 'fun' but its normal at this age.
BOTH my kids did that too, at that age.
They grow out of it.
For us though, we have a floor futon mattress in our bedroom. IF the kids need too, we let them sleep there. And, if they need extra comforting, I lay next to them for a bit. Then I can get up and leave.
When I was that age and older, I would do that too. For me as a child, I just really hated being in my room all by myself in the dark and I would get scared of any noises or imagined things I saw. Then I would walk down our long dark hallway, and go to my parents room and sleep with them. They let me. Kids do that. Its normal. I grew out of it. I am not 'dependent' or 'needy' or anything. But as a child, that is how I felt, about night time.
2 years old, is a time of GREAT flux, developmentally. AND their sleep gets kinks too. BOTH my kids did that. I know it's normal and due to their growing pains.
BUT it WILL get back to normalcy. Just don't turn it into a 'battle' or it will be harder.
Sure, consistency and routine is important... but when a child is going through this, they will still wake up. AND at this age, 'night-time' fears and night-mares do creep in developmentally. Even at 5-6-7 years old, kids are afraid of night-time and 'boogey' men type things. Their imaginations are very active at this age.
All the punishments and scoldings and incentives will not work... if the child is going through normal developmental changes and growing pains, because it is cognitive changes.
When my kids did that at that age, I just kept things 'boring' and quiet, I didn't engage but would just tell them to lay down with Mommy.... I kept everything dark, did not 'wake' myself, and just made believe I was sleeping too. Gradually, in about 1/2 - 1 hour, my kids would fall back asleep. It was a PHASE. Then, they returned to their previous normal sleeping patterns and abilities.
Yes, this is typical developmental "difficulties." Its not fun for the Parent... but its not fun for them either. THEY are the one's having a hard time sleeping and being tired.
IT WILL PASS. IT WILL RETURN TO NORMALCY.
Don't worry.
Its just part of MANY sleep changes a child goes through. Even Teenagers and college kids and adults have sleep changes too on occasion. Right? So, for this mere young age..... in the broad scheme of things, its just a drop in a bucket. Many more phases will come up.
All the best,
Susan