Javascript Conversion Functions In Sql