Monthly Archives: July 2009

SQL function to convert number to words

Can’t claim credit for this. I got this from quite sometime ago. Lost the link. CREATE FUNCTION dbo.fn_num_to_words ( @n bigint ) RETURNS varchar(1000) AS BEGIN RETURN ( SELECT CASE (@n / 1000000) % 10 WHEN 1 THEN ‘one’ … Continue reading

Posted in SQL Server 2005/2008 | Leave a comment