petre ricardo

petre ricardo

  • NA
  • 194
  • 0

problem with a stored procedure, update issue!

Nov 15 2009 12:37 PM



Hi Friend,
Hi, i have posted the similar kind question befor ebut still cannot figureout what teh ptoblem is i have removed all
unessary parenthsis, addition PK search in my update statement still my update procedure doesnt update the table...
I've tested this with the SQL server management studio express by right click on Stored Procedure (SP) --> execute
when i alter data in table it doesnt update the table.... i'm sure that if i fix this i would able to capture concurrecy violations
here her snippet of my SP


set
ANSI_NULLS ON
set
QUOTED_IDENTIFIER ON
GO

ALTER
PROCEDURE [dbo].[ProcUpdateDesignation]
(

@Name
nvarchar(50),
@AnnualLeaveMax
int,
@SickLeaveMax
int,
@EntryDate
datetime,
@UpdatedDate
datetime,
@Original_DesigIndex
int,
@Original_Name
nvarchar(50),
@Original_AnnualLeaveMax
int,
@Original_SickLeaveMax
int,
@Original_EntryDate
datetime,
@Original_UpdatedDate
datetime
)

AS
SET
NOCOUNT OFF;
UPDATE
[tblDesignations]
SET

[Name]
= @Name,
[AnnualLeaveMax]
= @AnnualLeaveMax,
[SickLeaveMax]
= @SickLeaveMax,
[EntryDate]
= @EntryDate,
[UpdatedDate]
= @UpdatedDate
WHERE

(

[DesigIndex]
= @Original_DesigIndex
AND

[Name]
= @Original_Name
AND

[AnnualLeaveMax]
= @Original_AnnualLeaveMax
AND

[SickLeaveMax]
= @Original_SickLeaveMax
AND

[EntryDate]
= @Original_EntryDate
AND

[UpdatedDate]
= @Original_UpdatedDate
)

 

 

I have uploaded the DB and you can downlaod it from the followin link http://www.mediafire.com/?t3iojnd2mmx

Thanks
petre
 

Answers (3)