The objective of this study was to describe and analyze the gastrointestinal tolerability and medication switching in patients receiving treatment for primary osteoporosis in Sweden. The study was based on all patients starting therapy with alendronate, risedronate, strontium ranelate, and raloxifene in Sweden between 2005 and 2009. The primary outcome measure was start of treatment with a gastroprotective agent, and the secondary outcome was hospitalization for a gastrointestinal adverse event (GIAE). Switching was analyzed while patients were on treatment. The crude incidence of gastroprotective treatment during the first 6 months after initiation of osteoporosis therapy was 5.14%, 5.93%, 4.25%, and 2.86% for patients prescribed alendronate, risedronate, strontium ranelate, and raloxifene, respectively. Patients prescribed raloxifene had a significantly lower risk of filling a prescription for a gastroprotective agent compared with alendronate. There was no significant difference in the risk of hospitalization for GIAEs. Less than 3% switched therapy while on treatment. Patients prescribed risedronate, strontium ranelate, and raloxifene had a significantly higher risk of switching compared with patients taking alendronate. In conclusion, no significant difference in the incidence of GIAEs was found between patients prescribed alendronate, risedronate, and strontium ranelate. Individuals prescribed raloxifene had a significantly lower risk of GIAEs compared with patients prescribed alendronate. No significant difference was found in the frequency of hospitalization for GIAEs. Switching between osteoporosis medications and drug classes was uncommon. Prescribers should consider the real-world gastrointestinal safety of osteoporosis drugs when choosing between treatment options to potentially improve medication adherence and consequently effectiveness.