Skip to Content.
Sympa Menu

freetds - RE: conversion status

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: RE: conversion status
  • Date: 30 Aug 2002 20:23:04 +0200


>
> MS documentation says binary & image store "a string of bits". I know what
> that means in theory, but not in (their) practice.
>
> 1> create table #i(i varbinary(20))
> 2> insert #i values ( 0x100 )
> 3> insert #i values ( 0x11223344 )
> 4> select * from #i
> 5> go
> i
> ------------------------------------------
> 0x01
> 0x11223344
>
> 1> select cast(i as int) from #i
> 2> go
>
> -----------
> 1
> 287454020
>
> $printf "%x\n" 287454020
> 11223344
>
> I don't know about you, maestro, but where I come from I'll trade you 1 for
> 0x100 any day of the week. I would have expected the first row to be 256.
>
1> select convert(varchar,convert(varbinary,0x741))
2> go

A (I hear also a beep 0x7)

Mm... arghhh.. so... our conversion from varchar to binary is broken...
??

freddy77







Archive powered by MHonArc 2.6.24.

Top of Page