Sub-diffraction needle beams with high intensity, sub-diffraction focal size, and long depth of focus (DOF) have attracted many researchers’ attention. However, the traditional methods for needle beam generation typically require many devices, such as phase elements, amplitude filters, and lens, which leads to a complex and bulky system and unfavorable for their integration. To address these challenges, we use a single multifunctional transmissive metasurface to convert a linearly polarized plane wave into a needle beam in the microwave range. The guided wave inspired unit cells of the proposed metasurface is designed to simultaneously and independently modulate the polarization and phase of transmitted waves. By imposing the desired polarization and phase distributions on the metasurface, the proposed multifunctional transmissive metasurface can efficiently generate a needle beam with subdiffraction size and extended DOF at 10 GHz when it is illuminated by an x-polarized wave. The proposed metasurface is fabricated, and a sub-diffraction needle beam with good performance is obtained in our measurements. In addition, a proof-of-concept of a high-resolution nondestructive testing experiment based on our designed metasurface is accomplished. Our work is expected to have potential applications in nondestructive testing of materials and structures.