Involved in the biosynthesis of the osmoprotectant glycine betaine from choline (PubMed:8752328, PubMed:9297465). Catalyzes the oxidation of betaine aldehyde to betaine (PubMed:9297465). Shows specificity for betaine aldehyde as substrate. Can use both NAD(+) and NADP(+), but NAD(+) is strongly preferred (PubMed:9297465). betaine aldehyde + H2O + NAD(+) = glycine betaine + 2 H(+) + NADH Activity is stimulated by low concentrations of salts and by moderate concentrations of glycine betaine. Highly tolerant to high ionic conditions. In vitro, activity is highly stimulated in the presence of proline. Optimum pH is 8.0. Amine and polyamine biosynthesis; betaine biosynthesis via choline pathway; betaine from betaine aldehyde: step 1/1. Homodimer. By choline and by high osmolarity in the presence of choline (PubMed:8752328, PubMed:22408163). Repressed by GbsR (PubMed:22408163). Deletion of the gbsAB genes abolishes the choline-glycine betaine synthesis pathway and the ability of B.subtilis to deal effectively with high-osmolarity stress in choline- or glycine betaine aldehyde-containing medium (PubMed:8752328). No effect on vanillin degradation (PubMed:26658822). Belongs to the aldehyde dehydrogenase family.