Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
ALTER procedure [dbo].[usp_assignedto]
(
@employeeid int,
@issuetrackerid int,
@testerid int
--@status int
)
as
begin 
set nocount on
 
if (status !=1) or (status !=2)
begin 
update issuesdetails set assignedto = @employeeid , testerassign=@testerid where issuetrackerid=@issuetrackerid
end
begin
update issuesdetails set assignedto=@employeeid,status =2 , testerassign=@testerid where issuetrackerid=@issuetrackerid
end
 
 
end


First of all the "if (status !=1) or (status !=2)" this condition is not working , if i pass the parameter @status It works but I am not passing any parametr from front end so I cant pass this parameter . So Please give substitute for this also .

I tried using this , the previous issue of updating the status label for all the issue is resolved but now I cant update the status , On submit click no change occur.

Please give me some solution
 
[edit]Urgency deleted - OriginalGriff[/edit]
Posted 19-Apr-13 2:04am
Edited 19-Apr-13 2:09am
v3
Comments
OriginalGriff at 19-Apr-13 7:06am
   
Urgency deleted: It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
PrashantSonewane at 19-Apr-13 7:11am
   
Even before its now working, I wonder why you are not getting "Invalid column name 'status'" error. Where you have declared or selected that? Please try executing it again. you will get answer yourself. And how we will know what is status and what value it holds? Please improve the question.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Think about what you are saying:
if (status !=1) or (status !=2)
Show me a single value that fails that test. Did you mean AND rather than OR?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can just swap the update statement like:
IF (status =1) OR (status =2)--What status is doing here? From where it came? Get the value for it from your table.
BEGIN 
	UPDATE issuesdetails SET assignedto=@employeeid,status =2 , testerassign=@testerid WHERE issuetrackerid=@issuetrackerid
END
ELSE
BEGIN
	UPDATE issuesdetails SET assignedto = @employeeid , testerassign=@testerid WHERE issuetrackerid=@issuetrackerid
END
 

--Amit
  Permalink  
Comments
Member 9954101 at 19-Apr-13 7:39am
   
sorry I forget to link my previous question .I have two tables one is status having statusid and staatus name etc etc and the other table is issuedetails which is taking the status id from status table and updating the status on the label I have . So I am applying this procedure to update the issuesdetails. This Procedure is implemented on the click event which is updating the status when any value is selected from the dropdown list which i have on the page to assign .
 
I hope you get the issue

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

  Print Answers RSS
0 OriginalGriff 400
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 245
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 19 Apr 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