How early can a baby be born and have a chance of survival?

I’m 24 weeks and I get some real sharp pains at times.. it comes across my mind what if my body went into labour and what are the chances of survival at this stage!