The original version has some problems in SQL 2000. Correct the error and run it in SQL 2000.
/*************************************** *****************
Author: (wleii165@yahoo.com)
Version: 1.0
Creation Time: 20020227
Modification time:
Function: converts the lowercase value to uppercase.
Parameter: n_LowerMoney lower-case amount
V_TransType type -- 1: directly translate, 0: read it in words
Output: capital amount
**************************************** ****************/
Create procedure dbo. L2U
(
@ N_LowerMoney numeric (15, 2 ),
@ V_TransType int,
@ Ret varchar (200) output
)
AS
Declare @ v_LowerStr VARCHAR (200) -- lower case amount
Declare @ v_UpperPart VARCHAR (200)
Declare @ v_UpperStr VARCHAR (200) -- Capital Amount
Declare @ I _ I int
Set nocount on
Select @ v_LowerStr = LTRIM (RTRIM (STR (@ n_LowerMoney, 20, 2) -- returns the specified precision and deletes the Left and Right spaces of the data.
Select @ I _ I = 1
Select @ v_UpperStr =''
While (@ I _ I <= len (@ v_LowerStr ))
Begin
Select @ v_UpperPart = case substring (@ v_LowerStr, len (@ v_LowerStr)-@ I _ I 1, 1)
WHEN '. 'then' yuan'
WHEN '0' THEN '0'
WHEN '1' THEN 'yi'
WHEN '2' THEN 'er'
WHEN '3' THEN 'san'
WHEN '4' then'
WHEN '5' then' Wu'
WHEN '6' THEN 'l'
WHEN '7' then' THEN'
WHEN '8' then' THEN'
WHEN '9' then' THEN'
END
Case @ I _ I
WHEN 1 THEN 'Min'
WHEN 2 THEN 'angular'
WHEN 3 then''
WHEN 4 then''
WHEN 5 THEN 'start'