Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 an image urgent issue

Author  Topic 

aomar
Starting Member

6 Posts

Posted - 2008-01-29 : 18:07:03
in my DB there is a table which contains an image column

the problem : when i insert a record (with a specific image) in that table i want to know if there is a record which contain the same image or not

it is not available to use unique constraint and i cant to hold an image in a local variable

what can i do?

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-01-29 : 18:14:10
It may work to check if the binary_checksum(<Newimage>) matches any existing binary_checksum(<imageColumn>).
If the table is large it could be pretty expensive. If that seems to work though you may consider storing the binary_checksum along with the image and then index that column. I suppose it is mathmatically possible to have a false dupe but it may be highly unlikely. Not sure - maybe someone else can pipe in with a better idea

Be One with the Optimizer
TG
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-01-29 : 18:17:36
quote:
Specifies that the computation is over all the columns of the table. BINARY_CHECKSUM ignores columns of noncomparable data types in its computation. Noncomparable data types include text, ntext, image, cursor, xml, and noncomparable common language runtime (CLR) user-defined types.
Try to use the compatible function found here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70832


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

aomar
Starting Member

6 Posts

Posted - 2008-01-31 : 21:35:22
thanx for your care
Go to Top of Page
   

- Advertisement -