All updates to the mnemonic code

Source: Internet
Author: User

The two required functions:

Use [Oaerp]
GO
/****** object:userdefinedfunction [dbo].    [F_ch2py] Script date:12/31/2014 17:12:26 ******/
SET ANSI_NULLS on
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER function [dbo]. [F_ch2py] (@chn nchar (1))
Returns char (1)
As
Begin
DECLARE @n int
DECLARE @c char (1)
Set @n = 63

Select @n = @n +1,
@c = case au when @chn then char (@n) Else @c end
From
Select Top * FROM (
Select CHN =
' Acridine ' UNION ALL Select
' Eight ' union ALL select
' Cha ' union ALL Select
' Otah ' UNION ALL Select
' Ehegan ' UNION ALL Select
' FA ' UNION ALL Select
' Xu ' union ALL Select
' Hafnium ' UNION ALL Select
' Not ' union ALL select--because has no ' i '
' Not ' UNION ALL Select
' Ka ' UNION ALL Select
' Garbage ' UNION ALL Select
' 嘸 ' UNION ALL Select
' Hallasan ' UNION ALL Select
' Oh ' UNION ALL Select
' 妑 ' UNION ALL Select
' Seven ' union ALL Select
' 呥 ' UNION ALL Select
' SA ' UNION ALL Select
' He ' UNION ALL Select
' 屲 ' UNION ALL select--no ' u '
' 屲 ' UNION ALL select--no ' V '
' 屲 ' UNION ALL Select
' XI ' UNION ALL Select
' Ya ' UNION ALL Select
' As ' union ALL select @chn) as a
ORDER BY CHN COLLATE Chinese_prc_ci_as
) as B
Return (@c)
End


Use [Oaerp]
GO
/****** object:userdefinedfunction [dbo].    [F_gethelpcode] Script date:12/31/2014 17:12:30 ******/
SET ANSI_NULLS on
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo]. [F_gethelpcode] (
@cName VARCHAR (20))
RETURNS VARCHAR (12)
As
BEGIN
DECLARE @i SMALLINT, @l SMALLINT, @cHelpCode varchar, @e varchar, @iAscii SMALLINT
SELECT @i=1, @l=0, @cHelpCode = "
While @l<=12 and @i<=len (@cName) BEGIN
SELECT @e=lower (SUBSTRING (@cname, @i,1))
SELECT @iAscii =ascii (@e)
IF @iAscii >=48 and @iAscii <=57 or @iAscii >=97 and @iAscii <=122 or @iAscii =95
SELECT @[email protected] +@e
ELSE
IF @iAscii >=176 and @iAscii <=247
SELECT @[email protected] + dbo.f_ch2py (@e)
ELSE SELECT @[email protected]
SELECT @[email protected]+1, @[email protected]+1 END
RETURN @cHelpCode
END

To execute an UPDATE statement:

Update ggoods SET abc = (SELECT dbo. F_gethelpcode (name))

--name is the product name

All updates to the mnemonic code

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.