Hardcoding VARBINARY

I tried to save a hardcoded value to a VARBINARY column, and it complained that I needed to use CONVERT function

Here’s the things I tried:

– CONVERT(VARBINARY, ‘0x43d3a4334af’) : Returns 0x2333 (something other than the value)

– CAST(‘0x43d4a4334af’ AS VARBINARY) : Returns 0x21231 (something other than the value)

– Copy from another row – worked, but not a solution


SET Column = 0x43d3a4334f (without quotes) – works!


About vijayvepa

I'm a software consultant for Software Specialists Inc. currently working at Philips Respironics, Pittsburgh

One comment

  1. Vijay

    Correction:This works correctly:
    INSERT INTO Clinicians(ClinicianID, EncoreID)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: