>DECLARE @rows int >SET @rows = (SELECT COUNT(*) FROM Customers) >>@rows will now equal the number of records in the Customers table. That was easy, but that is not what I need.
>Id Data >--- ----- >1 <binary> >2 <binary> >3 <binary> >>
>DECLARE @Data binary(1024) >SET @Data = (SELECT Data FROM myTable WHERE Id = 2) >>
UPDATE Town SET Test = (0x45+Kod)Kod is other field from that table that has values from 1 to 176
DECLARE @data binary(1024) SET @data = (SELECT Test FROM Town WHERE Kod = 1) print @data -- 0x(1022 zeroes here)46 what is the result I expected.UPDATE: If you want the result with less zeroes change the type to be varbinary(), but because I nevber used that type of field till now I can't tell you if this is a new in SQL Server 2005 or not :o(. I must check tomorow.