How to convert "2004" into "2004"? Custom function!

xiaoxiao2021-03-06  63

Create Function [DBO]. [F_Num_Str] (@num int) returns varchar (100) asbegin declare @n_str varchar (20), @ I int search @ n_str = Cast (@num as varchar), @ i = 1, @ RE = '' while @i <= le (@n_str) begin set @ re = @ RE SUBSTRING ('zero one two three four five six seven eight nine ", casters (@n_str, @ i, 1) as int) 1, 1) set @ i = @ i 1 end return @reend

Zero Zibo Luo Lu Yu --- This is a spare, it is impossible to use this format.

--transfer

SELECT DBO.F_NUM_STR (12345789)

--return:

One two three four five seven eight nine

转载请注明原文地址:https://www.9cbs.com/read-114470.html

New Post(0)