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
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 15, 2009, 7:51 PM EST
0
Hi Petre,
I focued on these two column.
Code
[EntryDate],[UpdatedDate]
does the data in these columns contain the time componenet as
well? If so, the parametrs you passed from SP, should contain the
exact time componet too. Otherwise, this update statement will not be
executed.
If you want to remove the time component and check, do following.
SQL
ANDconvert(datetime, convert(char,EntryDate, 106)) =@Original_EntryDateANDconvert(datetime, convert(char,UpdatedDate, 106)) =@Original_UpdatedDate
If there is a time component in your parametrs, then you can remove the time component of those too.
petre ricardo155 reputationPosted Nov 16, 2009, 2:19 AM EST
0
Hi, thanks for the reply.... i think it's
necessary cast @ DB level however, at component orient its necessary, nevertheless, this is not a type issue more of passing date values of value bound columns... so it doesnt update! petre
Sreekanth199 reputationPosted Nov 16, 2009, 2:49 AM EST
0
r u sure..ur where conditions satify all ur "=" signs..
one problem may be ur table values are not = to ur where condtion values..
for eg:
1)in the case of [name] is a varchar if table value is with a space and ur compargng without the space and exact name i wont work....
2)another is datetime...without convaerting both ur table value and condion date value to eact dateformat like 2009-11-16 00:00:00 it wont
satisfy ur where condtion..
to solve this
check ur query by changing where condions...
ten u can easiy ...screw d error
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 15, 2009, 7:51 PM EST
I focued on these two column.
does the data in these columns contain the time componenet as well? If so, the parametrs you passed from SP, should contain the exact time componet too. Otherwise, this update statement will not be executed.
If you want to remove the time component and check, do following.
AND convert(datetime, convert(char,EntryDate, 106)) = @Original_EntryDate AND convert(datetime, convert(char,UpdatedDate, 106)) = @Original_UpdatedDate If there is a time component in your parametrs, then you can remove the time component of those too.petre ricardo155 reputationPosted Nov 16, 2009, 2:19 AM EST
thanks for the reply.... i think it's
necessary cast @ DB level however, at component orient its necessary, nevertheless, this is not a type issue more of passing date values of value bound columns... so it doesnt update!
petre
Sreekanth199 reputationPosted Nov 16, 2009, 2:49 AM EST