Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

work with binary

Status
Not open for further replies.

riska

Programmer
Apr 16, 2002
7
CZ
please, does anybody clue why it doesn't works:
(I've taken it from MSDN)

DECLARE @mybin1 binary(5), @mybin2 binary(5)
SET @mybin1 = 0xFF
SET @mybin2 = 0xA5

SELECT CAST(@mybin1 AS varchar(5)) + ' '
+ CAST(@mybin2 AS varchar(5))

It'll show nothing. (Convert binyry data type to varchar returns a empty string)
I tried this sample because I need to insert binary data from table into a file.

Thanks very much
 
declare your variables as varbinary instead of binary and it should work.

DECLARE @mybin1 varbinary(5), @mybin2 varbinary(5)


RT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top