In this study, the cgt gene my20, which encodes cyclodextrin glycosyltransferase (CGTase) and was obtained by the metagenome sequencing of marine microorganisms from the Mariana Trench, was codon optimized and connected to pET-24a for heterologous expression in Escherichia coli BL21(DE3). Through shaking flask fermentation, the optimized condition for recombinant CGTase expression was identified as 20°C for 18 h with 0.4 mM of isopropyl β-D-L-thiogalactopyranoside. The recombinant CGTase was purified by Ni2+-NTA resin, and the optimum pH and temperature were identified as pH 7 and 80°C, respectively. Activity was stable over wide temperature and pH ranges. After purification by Ni2+-NTA resin, the specific activity of the CGTase was 63.3 U/mg after 67.3-fold purification, with a final yield of 43.7%. In addition, the enzyme was used to transform L-ascorbic acid into 2-O-α-D-glucopyranosyl-L-ascorbic acid (AA-2G). The maximal AA-2G production reached 28 g/L, at 40°C, pH 4, 24 h reaction time, 50 g/L donor concentration, and 50 U/g enzyme dosage. The superior properties of recombinant CGTase strongly facilitate the industrial production of AA-2G.