use numeric literals not string.

INSERT INTO table1 VALUES (0xA6D4632C1)

note: if you cast a string, the actual ascii codes are used.

INSERT INTO table1 VALUES (cast(' ' as varbinary(1)))

will insert 0x20 and the unicode version

INSERT INTO table1 VALUES (cast(N' ' as varbinary(2)))

will insert 0x2000

-- bruce (sqlwork.com)



-- bruce (sqlwork.com)

"Johannes Lebek" <joh.lebekgSmPxA.Mde> wrote in message
news:ea1I2S8RDHA.1720TK2MSFTNGP10.phx.gbl...
> Hi,
> after a quick look at "Books Online" I still don't know how to insert
> hexadecimal values into a varbinary column.
> Using DB2, I would write the statement as follows:
>
> INSERT INTO table1 VALUES (X'A6D4632C1');
>
> Or Oracle:
>
> INSERT INTO table1 VALUES (HEXTORAW('A6D4632C1'));
>
> How do I achieve this using SQL Server 2000?
> Thanks in advance,
>
> Joh.
>
>
>