That is a good question. But, unfortunately, we would have to know more about it to give an answer. Your drain could be inserted into a slip joint, which would be a simple repair, or soldered into a "solder bushing" which can be somewhat difficult to do the first time you try. And you only get one chance to do it right.

: Need to know how to replace a lavatory drain pipe into a cast iron in the wall. Thanks