views:

63

answers:

1

I want to perform a 'SELECT' statement with a byte array (binary) parameter as a condition. I tried to google it, but didn't find anything useful.

In general, I keep information of files in the database. one of the properties is the file's hash (binary).

I want to give a hash to the SELECT statement, and get all rows with the same hash value.

+3  A: 
DECLARE @PARA BINARY
SET @PARA = 0X000
SELECT @PARA
SELECT 
    *
FROM
    [Table]
WHERE
    PARA = @PARA
rdkleine
Is there's anyway for doing this without 'DECLARE'? i'm using SqlServerCe which only allows one statement per command
Nissim
Thanks, I solved it using: "SELECT * FROM BL_FILES WHERE Hash = 0x + BitConverter.ToString(byte[]).Replace("-",string.Empty)
Nissim