List code page characters in order

  • Is there a resource that lists the characters of the code page of a collation in order?

    sp_helpsort doesn't seem to return much information.

    In particular, I want to be able to compare the ordering and comparison of characters in code (.Net C# and older c++) with SQL Server.

  • Not really what I'm after, but this sort of thing is a quick way

    (255 is an arbitrary value):

    DECLARE @cnt INT = 32;

    DECLARE @sql nvarchar(max) = ''

    WHILE @cnt < 255

    BEGIN

    if @cnt >32

    begin

    set @sql += ' union '

    end

    set @sql += ' select ''' + replace(char(@cnt), '''', '''''') + ''''

    SET @cnt = @cnt + 1;

    END;

    set @sql += ' order by 1'

    print @sql

    exec sp_executesql @sql

    ----

    !

    "

    #

    $

    %

    &

    '

    (

    )

    *

    +

    ,

    -

    .

    /

    :

    ;

    <

    =

    >

    ?

    @

    [

    ]

    ^

    _

    `

    {

    |

    }

    ~

    

    

    ƒ

    ˆ

    Š

    Œ

    

    Ž

    

    

    ˜

    š

    œ

    

    ž

    Ÿ

     

    ¡

    ¢

    £

    ¤

    ¥

    ¦

    §

    ¨

    ©

    ª

    «

    ¬

    ­

    ®

    ¯

    °

    ±

    ²

    ³

    ´

    µ

    ·

    ¸

    ¹

    º

    »

    ¼

    ½

    ¾

    ¿

    ×

    ÷

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    a

    À

    á

    Â

    ã

    Ä

    å

    Æ

    B

    c

    Ç

    D

    e

    È

    é

    Ê

    ë

    F

    g

    H

    i

    Ì

    í

    Î

    ï

    J

    k

    L

    m

    N

    Ñ

    o

    ò

    Ó

    ô

    Õ

    ö

    Ø

    P

    q

    R

    s

    ß

    T

    u

    ù

    Ú

    û

    Ü

    V

    w

    X

    y

    ý

    Z

    Ð

    Þ

    (167 row(s) affected)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply