Few weeks ago I had major stomach pains followed by vomiting lasting all night. Today same thing happened again but only lasted a few hours. What could be wrong?

Could be a bunch. Don't know you or details. Could be related to menses, ovarian cysts, pregnancy, ulcers, inflammatory bowel, internal hernias, bowel obstruction, lots of others. See your doc.