Re: Binary collation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael Thomas [Microsoft] (mithomas_at_online.microsoft.com)
Date: 11/16/04


Date: Tue, 16 Nov 2004 12:18:24 -0800

Hello Michael,

Did you try to cast the value to binary? Here's a sample i've just written:

create table mytable (Col1 nvarchar(20));

insert into mytable values (N'Die Nuß, die Nüsse');

select CAST ( Col1 AS binary (40)) from mytable

The query will return the following value as binary. Note that there is no
collation on binary.

0x44006900650020004E007500DF002C00200064006900650020004E00FC0073007300650000
000000

"Michael Bauers" <MichaelBauers@discussions.microsoft.com> wrote in message
news:54F4F3E1-0FD9-4209-9301-1182139A7DC1@microsoft.com...
> Is there a code page independent binary collation? I want a collation
that
> will sort binary order that will not force translations from other
collations.
>
> My problem is this: I want the user to be able to use any collation they
> want. My process is going to work with their data in binary order. Even
if
> I could retrieve the collation they used, I don't know how to, in a
program,
> to convert that collation into a binary collation. For some collations,
its
> obvious. If their collation was SQL_CZECH_CP1350_CI_AS I could probably
> construct Czech_BIN from that.



Relevant Pages

  • Re: Binary Collation for code page
    ... but I believe the BIN collations will sort the ... representations in the code page of the collation. ... binary order" isn't a well-defined statement, ...
    (microsoft.public.sqlserver.programming)
  • Binary Collation for code page
    ... latin-1 collations. ... binary order encoded in the same code page that their data ... LATIN1_GENERAL_BIN collation would it attempt to convert ... the data to the latin-1 code page, ...
    (microsoft.public.sqlserver.programming)
  • Re: Binary collation
    ... > Did you try to cast the value to binary? ... >> Is there a code page independent binary collation? ... My process is going to work with their data in binary order. ... >> I could retrieve the collation they used, I don't know how to, in a ...
    (microsoft.public.sqlserver.server)
  • Binary collation
    ... Is there a code page independent binary collation? ... will sort binary order that will not force translations from other collations. ... My process is going to work with their data in binary order. ...
    (microsoft.public.sqlserver.server)