SQL Server processing of Chinese characters and special characters

Brief introduction

    In SQL Server require a lot of special characters in some of the fields to do the processing, such as a field contains some returns, tabs, line breaks and other special characters (these characters often from Excel). The presence of these special characters may make it impossible to extract the required data, following a brief introduction to the handling of these special characters.

A special character handling

    char (10) linefeed (\ R & lt)

    char (13) carriage return ( \ n-  )

    char (9) horizontal tab (  \ T)

    For the three most common characters using only implicit in SQL Server REPLACE function to do the replacement. as follows:

  

 

In SQL Server char () full ASCII code table

(0—127)

 

 

 

 (128—255)

 

 

 

 Second, Chinese (kanji) processing

    In SQL Server characters interval [acridine - Block] , recent work, a lot of people have asked me to intercept Chinese characters in SQL Server \ extract, such as finding a location of the first occurrence of a string of Chinese characters, the string delete all the characters. Here to show you:

   

 

Guess you like

Origin www.cnblogs.com/VicLiu/p/11770698.html