I Stored Image in sql table using sql server 2005.Now I need to check Whether the image already exists or not.
My Code is Below
What I have tried:
CREATE PROCEDURE sptblEmployeeProofDetail
(
@SID numeric(18),@EmpSid numeric(18),@ProofTypeSID numeric(18),@ProofNo nvarchar(50),
@ProofPath nvarchar(100),@ProofImage image,@RevisionNo numeric(18),@CreatedBy numeric(18,3))
AS
BEGIN
IF ((Select Count(*) from tblEmployeeProofDetail where EmpSid=@EmpSid and ProofTypeSID=@ProofTypeSID
and ProofPath=@ProofPath and ProofImage=@ProofImage)>0)
BEGIN
Select Top 1 @RevisionNo = RevisionNo +1 from tblEmployeeProofDetail order by RevisionNo Desc
END
INSERT INTO tblEmployeeProofDetail
(EmpSid,ProofTypeSID,ProofNo,ProofPath,ProofImage,RevisionNo,CreatedBy,CreatedOn)
VALUES
(@EmpSid,@ProofTypeSID,@ProofNo,@ProofPath,@ProofImage,@RevisionNo,@CreatedBy,GETDATE())
END
The Error Message is
Msg 402, Level 16, State 1, Procedure sptblEmployeeProofDetail, Line 9
The data types image and image are incompatible in the equal to operator.