How do I Compare Thumb Image by the Select Statement in SQL Server 2005....?
-
hi, I am using SQL Server 2005 database. I stored Thumb Image on two tables to the Image data type field. When I compare these two images from both table is gives error... "The data types image and image are incompatible in the equal to operator" Statement : "Select FP1 From E_CH16APPLICANTS Where FP1 In (Select Photo From Tmp)" I just like to verify that this Thumb Image is exist or not... by using SQL Statement... Pls help me...
-
hi, I am using SQL Server 2005 database. I stored Thumb Image on two tables to the Image data type field. When I compare these two images from both table is gives error... "The data types image and image are incompatible in the equal to operator" Statement : "Select FP1 From E_CH16APPLICANTS Where FP1 In (Select Photo From Tmp)" I just like to verify that this Thumb Image is exist or not... by using SQL Statement... Pls help me...
check for NULL or DBNULL, or use IsNull; or something like that. No need to actually compare anything if I understood your question correctly. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
check for NULL or DBNULL, or use IsNull; or something like that. No need to actually compare anything if I understood your question correctly. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
Exactly I want to know... Can I Compare two Images stored in the Table...?????
-
hi, I am using SQL Server 2005 database. I stored Thumb Image on two tables to the Image data type field. When I compare these two images from both table is gives error... "The data types image and image are incompatible in the equal to operator" Statement : "Select FP1 From E_CH16APPLICANTS Where FP1 In (Select Photo From Tmp)" I just like to verify that this Thumb Image is exist or not... by using SQL Statement... Pls help me...
-
Exactly I want to know... Can I Compare two Images stored in the Table...?????
I'm no database expert at all, however I've never seen SQL code that compares big fields (blobs, images), and I expect that whenever you (think you) need it, you have a bad design to start with; there should be no doubt that the image, when present, is the right one (the only doubt I would allow for is whether the image is present at all); and IMO it would most always be wise to have a separate field that uniquely identifies the image (a hash or CRC would probably be fine). The only way I know to compare two blobs/images is by using a programming language (say C#), fetch the two blobs and compare their elements in a loop. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Convert Image field in Varbinary(Max) Ex: Select * From E_CH16APPLICANTS Where (Convert(VARBINARY(MAX), FP1) In (Select Convert(VARBINARY(MAX), Photo) From Tmp)
-
Convert Image field in Varbinary(Max) Ex: Select * From E_CH16APPLICANTS Where (Convert(VARBINARY(MAX), FP1) In (Select Convert(VARBINARY(MAX), Photo) From Tmp)
Never use
select *
. As a shortcut, it leads to bad programming habits and it can lead to hard to find bugs as columns get renamed in the underlying database. You should always choose to explicitly select columns instead, partly because usingselect *
typically results in columns being retrieved that aren't needed in the result set.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
Convert Image field in Varbinary(Max) Ex: Select * From E_CH16APPLICANTS Where (Convert(VARBINARY(MAX), FP1) In (Select Convert(VARBINARY(MAX), Photo) From Tmp)