iptrader
asked on
Insert into column with varbinary datatype
I need a small SQL snippet which will allow me to insert values into fields set as varbinary. Can anyone help please?
Thanks in advance,
IPT
Thanks in advance,
IPT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great! It worked. Can you please also tell me the correct syntax for converting the varbinary data into readable format (for instance, if I want to pass the data into a web browser via ASP).
Thanks a bunch.
Thanks a bunch.
Simply reverse it:
SELECT ID, Name, CAST(binarydata as int) FROM Test101
SELECT ID, Name, CAST(binarydata as int) FROM Test101
ASKER
Thank you!!!
insert into test101 values (1, 'Name', CAST(123445 AS VARBINARY))
insert into test101 values (1, 'Name', CAST('ABCDE' AS VARBINARY))