Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-server-2005
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 29-Aug-12 1:51am
Comments
__TR__ at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
0 Zoltán Zörgő 300
1 CHill60 185
2 Peter Leow 170
3 /\jmot 160
4 Pikoh 125
0 Sergey Alexandrovich Kryukov 9,383
1 OriginalGriff 6,881
2 Peter Leow 4,607
3 Zoltán Zörgő 4,284
4 CHill60 2,892


Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 6 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100