CREATEFUNCTION[dbo].[f_num_chn](@numnumeric(14,2))RETURNSvarchar(100)WITHENCRYPTIONASBEGIN--版权所有:pbsqlDECLARE@n_dataVARCHAR(20),@c_dataVARCHAR(100),@n
CREATE FUNCTION [dbo].f_num_chn] (@num numeric(14,2))
RETURNS varchar(100) WITH ENCRYPTION
AS
BEGIN
--版权所有:pbsql
DECLARE @n_data VARCHAR(20),@c_data VARCHAR(100),0)">@n_str VARCHAR(10),0)">@i int
SET @n_data=RIGHT(SPACE(14)+CAST(ABS(@num*AS bigint) AS varchar(20)),0)">14)
@c_data''
@i=1
WHILE <=14
BEGIN
@n_strSUBSTRING(@n_data,0)">@i,0)">1)
IF <>' '
BEGIN
IF not ((2)00') or
((0and ((4) or (8) 12) 14))))
=SUBSTRING(零壹贰叁肆伍陆柒捌玖',CAST(@n_str AS int)+1,0)">1)
not ((and (<>12))
仟佰拾亿仟佰拾万仟佰拾圆角分IF @c_data,255)">LEN(@c_data)-亿万'
END
END
<0
(负数)'+@c_data
零圆'
整RETURN(@c_data)
END