Click here to Skip to main content
15,886,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
BEGIN
 IF(@intDesignationId>0)
  BEGIN
IF EXISTS(SELECT 1 FROM dbo.tabDesignation WHERE  intDesignationId= @intDesignationId ) --AND  intBranchId=@intBranchId  )

    BEGIN
  
    UPDATE dbo.tabDesignation

     SET intcadreid =@intcadreid ,
    intDepartmentid =@intDepartmentid ,
    varDesignationName=@varDesignationName,
    varDesignationShortName=@varDesignationShortName,
    intRetirementAge=@intRetirementAge,
    varRemarks=@varRemarks,
    varOfferLetterType=@varOfferLetterType
    WHERE  intDesignationId=@intDesignationId
     
 RETURN 0
 end


  ELSE
 RETURN 1


  END
Posted
Comments
__TR__ 29-Aug-12 6:53am    
What do you mean by "Need To Check The Dupilications Also" ? Can you elaborate a little more on what you want.

1 solution

To check duplicates, you can simply check whether such record exists. Use if exists with Where condition
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900