Convert lowercase to uppercase

Source: Internet
Author: User

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'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.