Is Bactrim safe?

So I posted awhile back about a UTI and not feeling symptoms (which is odd for me) but the antibiotics they put me on didn't do anything. I'm now being prescribed Bactrim and have been reading that it's not safe to take while pregnant. Anyone know anything about this? I'm sure my doc wouldn't put me on anything that he though would harm the baby but I need some reassurance!