NCHAR NCHAR - 北京怡康軟件科技有限公司 資源網(wǎng) "/>

精品国产亚洲一区二区三区,男女作爱在线观看免费网站,欧美的又大又长做禁片A片,97国产精品人妻无码久久久

  • 相關(guān)軟件
    >NCHAR 創(chuàng)建者:webmaster 更新時(shí)間:2006-02-16 15:51

    根據(jù) Unicode 標(biāo)準(zhǔn)所進(jìn)行的定義,用給定整數(shù)代碼返回 Unicode 字符。



    語法


    NCHAR ( integer_expression )



    參數(shù)


    integer_expression



    介于 0 與 65535 之間的所有正整數(shù)。如果指定了超出此范圍的值,將返回 NULL。



    返回類型


    nchar(1)



    示例


    A. 使用 NCHAR 和 UNICODE


    下面的示例使用 UNICODE 和 NCHAR 函數(shù)打印字符串 Køenhavn 第二個(gè)字符的 UNICODE 值和 NCHAR(Unicode 字符),并打印實(shí)際的第二個(gè)字符ø。



    DECLARE @nstring nchar(8)
    SET @nstring = N'K
    øbenhavn'
    SELECT UNICODE(SUBSTRING(@nstring, 2, 1)),
      NCHAR(UNICODE(SUBSTRING(@nstring, 2, 1)))
    GO


    下面是結(jié)果集:



    ----------- - 
    248      
    ø(1 row(s) affected)


    B. 使用 SUBSTRING、UNICODE、CONVERT 和 NCHAR


    下面的示例使用 SUBSTRING、UNICODE、CONVERT 和 NCHAR 函數(shù)打印字符串 Køenhavn 的字符數(shù)、Unicode 字符以及每個(gè)字符的 UNICODE 值。



    -- The @position variable holds the position of the character currently
    -- being processed. The @nstring variable is the Unicode character
    -- string to process.
    DECLARE @position int, @nstring nchar(9)
    -- Initialize the current position variable to the first character in
    -- the string.
    SET @position = 1
    -- Initialize the character string variable to the string to process.
    -- Notice that there is an N before the start of the string, which
    -- indicates that the data following the N is Unicode data.
    SET @nstring = N'K
    øbenhavn'
    -- Print the character number of the position of the string you're at,
    -- the actual Unicode character you're processing, and the UNICODE value -- for this particular character.
    PRINT 'Character #' + ' ' + 'Unicode Character' + ' ' + 'UNICODE Value'
    WHILE @position <= DATALENGTH(@nstring)
      BEGIN
      SELECT @position,
        NCHAR(UNICODE(SUBSTRING(@nstring, @position, 1))),
        CONVERT(NCHAR(17), SUBSTRING(@nstring, @position, 1)),
        UNICODE(SUBSTRING(@nstring, @position, 1))
      SELECT @position = @position + 1
      END
    GO


    下面是結(jié)果集:



    Character # Unicode Character UNICODE Value
                               
    ----------- ----------------- -----------
    1       K           75      
                               
    ----------- ----------------- -----------
    2      
    ø           248      
                               
    ----------- ----------------- -----------
    3       b           98      
                               
    ----------- ----------------- -----------
    4       e           101      
                               
    ----------- ----------------- -----------
    5       n           110      
                               
    ----------- ----------------- -----------
    6       h           104      
                               
    ----------- ----------------- -----------
    7       a           97      
                               
    ----------- ----------------- -----------
    8       v           118      
                               
    ----------- ----------------- -----------
    9       n           110      
                               
    ----------- ----------------- -----------
    10       (null)         (null)    
                               
    ----------- ----------------- -----------
    11       (null)         (null)    
                               
    ----------- ----------------- -----------
    12       (null)         (null)    
                               
    ----------- ----------------- -----------
    13       (null)         (null)    
                               
    ----------- ----------------- -----------
    14       (null)         (null)    
                               
    ----------- ----------------- -----------
    15       (null)         (null)    
                               
    ----------- ----------------- -----------
    16       (null)         (null)    
                               
    ----------- ----------------- -----------
    17       (null)         (null)    
                               
    ----------- ----------------- -----------
    18       (null)         (null)
    相關(guān)文章
    本頁查看次數(shù):