The area that is dug around the pipe is known as a trench. This process is effective, but it is too time consuming and damages your floor, backyard and so on.
Due to excess moisture in the area, the drain area is bound to leave this odor. The other reasons for this smell could be malfunctioning of the p-trap, which allows the sewer gas to rise up through the pipes.