Skip to Content.
Sympa Menu

freetds - RE: [freetds] collate and TDS8

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] collate and TDS8
  • Date: 07 Dec 2002 15:13:00 +0100

> I have (pruned for mail):
>
> 1> sp_configure
> 2> go
> name config_value run_value
> --------------------------- ------------ -----------
> default full-text language 1033 1033
> default language 0 0
> show advanced options 1 1
> user connections 0 0
> user options 0 0
>

Same

> 1> sp_helpsort
> 2> go
> Server default collation
> --------------------------------------
> Latin1-General, binary sort
>
> > All this stuff are defined in windows...
> > 10 bit for language (low), other for sublanguage.
> > English (9) american (1) is 0x409 -> 1033
>

Mine is

Server default collation
Latin1-General, case-insensitive, accent-sensitive,
kanatype-insensitive, width-insensitive for Unicode Data, SQL Server
Sort Order 52 on Code Page 1252 for non-Unicode Data
(return status = 0)


> Yes, but:
>
> 1> select langid, lcid, msglangid, cast(name as char(30)) as name from
> syslanguages where langid = 23
> 2> go
> langid lcid msglangid name
> ------ ----------- --------- ------------------------------
> 23 1033 1033 British
>
> The "sublanguage" wouldn't affect collation. Maybe that's why it doesn't
> appear in syslanguages.
>
> > > > - 2 bytes ???
> > >
> > > My next two bytes are always 00 01:
> > >
> >
> > Mines are 0d 00 (0xd0 in LE??)...
> > Full lcid on windows as also sort (bits 19-16) and version
> > (bits 23-20)
>

Perhaps
Mine 0xd0 -> 0000 0000 1101 0000 -> third: 1 width insensitive 1
katatype insensitive 0 accent sensitive 1 case insensitive
Yours 0x100 -> 0000 0001 0000 0000 -> second: 0 0 0 1 binary third 0000
all insensitive.
Other bits ??

> Let's say we don't know anything about the next three bytes.
>
> I have: 00 01 00
> You have: d0 00 34
>

Last is 0 or SQL charsets id (only used for SQL coding)

> Our servers are configured the same way, except I use binary sorting order
> (33280, 0x8200).
>
> If the fifth byte is, as you said, syscharsets.id, then mine should be 0x32
> (50). But mine's the default <shrug>. Perhaps I'm using SQL collation
> instead of Windows collation? (I don't know how it was set up.) I can't
> reconfigure my server to test that theory.
>
> Your 0x34 tells us the sort order (and implies the character set).
>
> That leaves bytes 3 and 4. If they're a 16-bit int, you have 0x0d (13) and
> I 0x100 (256).
>
> It can't be our client settings, because we don't transmit character set
> information to the server, to it can't know what we use/want.
>
> So far, the server's told us about the column:
>
> datatype, size, name
> locale id (bytes 1-2)
> syscharset.id (collation method and character set, byte 5)
>
> What more could we want to know? Country, language?
>
> Do we care?
>
> Regards,
>

Are all supposition...

Yes we case, I must send something to the server. I just fixed this. For now
i sent same data passed from server during login (handling env change type 7)

Also I exec this query on a mssql2k

declare mycur cursor for select name from ::fn_helpcollations()
declare @name varchar(200)
open mycur
fetch next from mycur into @name
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC('SELECT ''pippo'' COLLATE ' + @name + ', ''' + @name + '''')
fetch next from mycur into @name
END
close mycur
deallocate mycur

Results at http://freddy77.tripod.com/downloads/out2.txt.bz2 (I used bz2 for
size, now is 97kb compressed, not suitable for mail)
Still unwatched...

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page