How to extract Chinese characters using MSSQL-mysql tutorial

Source: Internet
Author: User
SQL statement for extracting Chinese characters under sqlserver. For more information, see.

SQL statement for extracting Chinese characters under sqlserver. For more information, see.

The code is as follows:
--> Title: generate a sequence number.
--> Author: wufeng4552
--> Date: 09:02:08

If object_id ('dbo. get_china_str ') is not null drop function dbo. get_china_str
Go
Create function dbo. get_china_str
(
@ Str nvarchar (200)
)
Returns nvarchar (200)
As
Begin
Declare @ I int
Set @ I = 1
While @ I <= len (@ str)
Begin
If len (unicode (substring (@ str, @ I, 1) <5
Begin
Set @ str = stuff (@ str, @ I, 1 ,'');
End
Else
Set @ I = @ I + 1;
End
Return @ str
End
Go
Select dbo. get_china_str ')

/*
We are all Chinese, both Chinese descendants and descendants of the Dragon

(A data column is affected)

*/

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.