Ref: http://www.novicksoftware.com/udfofweek/Vol2/T-SQL-UDF-Vol-2-Num-9-udf_Num_ToWords.htm SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON SET NOCOUNT ON GO CREATE FUNCTION dbo.NumToWords ( @Number Numeric (38, 0) -- Input number with as many as 18 digits ) RETURNS VARCHAR(8000) AS BEGIN DECLARE @inputNumber VARCHAR(38) DECLARE @NumbersTable TABLE (number CHAR(2), word VARCHAR(10)) DECLARE @outputString VARCHAR(8000) DECLARE @length INT DECLARE @counter INT DECLARE @loops INT DECLARE @position INT DECLARE @chunk CHAR(3) -- for chunks of 3 numbers DECLARE @tensones CHAR(2) DECLARE @hundreds CHAR(1) DECLARE @tens CHAR(1) DECLARE @ones CHAR(1) IF @Number = 0 Return 'Zero' -- initialize the variables SELECT @inputNumber = CONVERT(varchar(38), @Number) , @outputString = '' , @counter = 1 SELECT @length = LEN(@inputNumber) , @position = LEN(@inputNumber) - 2 , @loops = LEN(@inputNumber)/3 -- make sure there is an ext...