A process for the preparation of a betaine, comprising: a) producing an ester of formula 2: b) reacting a dialkylamino alcohol 3: with 2 in the presence of an enzyme Candida antartica lipase B immobilized on acrylic resin to form an intermediate 4: c) reacting intermediate 4 with sodium chloroacetate to produce a betaine; wherein R is selected from the group consisting of branched and straight-chain, saturated, unsaturated and polyunsaturated C 1 -C 22 hydrocarbyl, C 3 -C 8 cycloalkyl, C 6 -C 20 carbocyclic aryl, and C 4 -C 20 heterocyclic wherein the heteroatoms are selected from the group consisting of sulfur, nitrogen, oxygen, and mixtures thereof, R 6 is a straight or branched chain C 1 -C 6 alkyl, R 1 and R 2 are the same or are independently selected from the group consisting of straight or branched-chain C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 4 -C 6 dienyl, and C 3 -C 8 cycloalkyl, and A is selected from the group consisting of branched and straight-chain, saturated, unsaturated and polyunsaturated C 1 -C 10 divalent hydrocarbyl, C 3 -C 8 cycloalkylene, C 6 -C 10 carbocyclic arylene, and C 4 -C 10 divalent heterocyclic wherein the heteroatoms are selected from sulfur, nitrogen, and oxygen; and wherein said hydrocarbyl group in R and/or said divalent hydrocarbyl group in A may be substituted with one to five groups selected from C 1 -C 6 -alkoxy, carboxyl, amino, C 2 -C 16 aminocarbonyl, C 2 -C 16 amido, cyano, C 2 -C 7 -alkoxycarbonyl, C 2 -C 7 -alkanoyloxy, hydroxy, aryl, heteroaryl, thiol, thioether, C 2 -C 10 dialkylamino, C 3 -C 15 trialkylammonium and halogen; and wherein said alkyl, alkenyl and dienyl groups in R 1 and R 2 may be substituted with one to three groups selected from C 1 -C 6 -alkoxy, carboxyl, amino, C 2 -C 16 aminocarbonyl, C 2 -C 16 amido, cyano, C 2 -C 7 -alkoxycarbonyl, C 2 -C 7 -alkanoyloxy, hydroxy, aryl, heteroaryl, thiol, thioether, C 2 -C 10 dialkylamino, C 3 -C 15 trialkylammonium and halogen, wherein the branching and/or substitution of R 1 and R 2 may connect to form a ring. a) producing an ester of formula 2: b) reacting a dialkylamino alcohol 3: with 2 in the presence of an enzyme Candida antartica lipase B immobilized on acrylic resin to form an intermediate 4: c) reacting intermediate 4 with sodium chloroacetate to produce a betaine; wherein R is selected from the group consisting of branched and straight-chain, saturated, unsaturated and polyunsaturated C 1 -C 22 hydrocarbyl, C 3 -C 8 cycloalkyl, C 6 -C 20 carbocyclic aryl, and C 4 -C 20 heterocyclic wherein the heteroatoms are selected from the group consisting of sulfur, nitrogen, oxygen, and mixtures thereof, R 6 is a straight or branched chain C 1 -C 6 alkyl, R 1 and R 2 are the same or are independently selected from the group consisting of straight or branched-chain C 1 -C 6 alkyl, C 2 -C 6 alkenyl, C 4 -C 6 dienyl, and C 3 -C 8 cycloalkyl, and A is selected from the group consisting of branched and straight-chain, saturated, unsaturated and polyunsaturated C 1 -C 10 divalent hydrocarbyl, C 3 -C 8 cycloalkylene, C 6 -C 10 carbocyclic arylene, and C 4 -C 10 divalent heterocyclic wherein the heteroatoms are selected from sulfur, nitrogen, and oxygen; and wherein said hydrocarbyl group in R and/or said divalent hydrocarbyl group in A may be substituted with one to five groups selected from C 1 -C 6 -alkoxy, carboxyl, amino, C 2 -C 16 aminocarbonyl, C 2 -C 16 amido, cyano, C 2 -C 7 -alkoxycarbonyl, C 2 -C 7 -alkanoyloxy, hydroxy, aryl, heteroaryl, thiol, thioether, C 2 -C 10 dialkylamino, C 3 -C 15 trialkylammonium and halogen; and wherein said alkyl, alkenyl and dienyl groups in R 1 and R 2 may be substituted with one to three groups selected from C 1 -C 6 -alkoxy, carboxyl, amino, C 2 -C 16 aminocarbonyl, C 2 -C 16 amido, cyano, C 2 -C 7 -alkoxycarbonyl, C 2 -C 7 -alkanoyloxy, hydroxy, aryl, heteroaryl, thiol, thioether, C 2 -C 10 dialkylamino, C 3 -C 15 trialkylammonium and halogen, wherein the branching and/or substitution of R 1 and R 2 may connect to form a ring.