Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign value to @local_variable
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01077688
Message ID:
01077703
Views:
34
Borislav,
Thanks for the reply. A couple of minutes after posting a light went on and I realised that the ID that I had in the WHERE clause did not exist in the table. After I used an ID that existed it worked the way I expected it to work.
No I do want to use binary and not varbinary (I think it has been around a long time I am using SQL2000), my data has a fixed length and can not be null so I feel binary is better.

Einar


>Einar,
>It works for me.
>I have a table with field Test binary(1024)
>The test field is updated that way:
>
>UPDATE Town SET Test = (0x45+Kod)
>
>
>Kod is other field from that table that has values from 1 to 176
>
>In SQL MStudio I do:
>
>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.
Semper ubi sub ubi.
Previous
Reply
Map
View

Click here to load this message in the networking platform