解決方案之一(在SqlServer2000中測試通過): CREATE FUNCTION fun_cgnum (@num INT) RETURNS VARCHAR(100) AS BEGIN DECLARE @temp INT,@res INT,@i TINYINT DECLARE @str VARCHAR(100),@no VARCHAR(20),@unit VARCHAR(16) SELECT @str='',@no='另壹貳叁肆伍陸柒捌玖',@unit='拾佰仟萬拾佰仟億' SET @temp=@num SELECT @i=0,@res=@temp%10,@temp=@temp/10 WHILE @temp>0 BEGIN IF @i=0 SET @str=SUBSTRING(@no,@res+1,1) ELSE SET @str=SUBSTRING(@no,@res+1,1)+SUBSTRING(@unit,@i,1)+@str SELECT @res=@temp%10,@temp=@temp/10 SET @i=@i+1 END SET @str=SUBSTRING(@no,@res+1,1)+SUBSTRING(@unit,@i,1)+@str SET @str=REPLACE(@str,'另拾','另') SET @str=REPLACE(@str,'另佰','另') SET @str=REPLACE(@str,'另仟','另') SET @str=REPLACE(@str,'另拾','另') SET @str=REPLACE(@str,'另萬','萬') WHILE @i>0 BEGIN SET @str=REPLACE(@str,'另另','另') SET @i=CHARINDEX('另另',@str) END SET @str=REPLACE(@str,'另萬','萬') SET @str=REPLACE(@str,'億萬','億') IF RIGHT(@str,1)='另' SET @str=LEFT(@str,LEN(@str)-1) RETURN @str END GO