If you took all the time-consuming steps to receive a B-2 visitor visa to the United States, you certainly want to be able to keep using that visa even if you need to replace your passport.
For example, if your passport expired - but your visitor visa has not - what do you need to do to travel to the U.S.? Is it necessary to apply with the U.S. consulate all over again and get a new visa placed in your new passport? Thankfully, the good news is that you can continue to use your original visa together with your new passport. How do you do this?
After you receive your new passport - because the old one expired or because your name changed, for example - you can simply present both your old passport (which contains your valid visa) along with your new passport to US customs officers when seeking entrance to the U.S.
For example here's what the US Embassy in Honduras recommends you do:
You may travel with a valid passport and a valid, unexpired visa in an expired passport. You can staple or clip the two passports together. If you want, you may also apply for a new visa with your new, but you must go through the regular visa application procedure.
Therefore, take heart: by clipping the two passports together, you'll be able to continue traveling on your valid visa even if it's contained in your original expired passport. (Of course, keep in mind that a valid visa is no guarantee that you'll actually be admitted to the U.S. You still need to satisfy a CBP officer that you don't have immigrant intent and that there are no other reasons you are "inadmissible.")