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 0: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 OriginalGriff 383
1 ChauhanAjay 186
2 Richard Deeming 180
3 Sergey Alexandrovich Kryukov 171
4 Yogesh Kumar Tyagi 165
0 Sergey Alexandrovich Kryukov 6,252
1 OriginalGriff 5,498
2 CPallini 2,473
3 Richard MacCutchan 1,627
4 Abhinav S 1,530


Advertise | Privacy | Mobile
Web04 | 2.8.140821.2 | Last Updated 6 May 2013
Copyright © CodeProject, 1999-2014
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