Click here to Skip to main content
16,004,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
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
Updated 19-Apr-13 1:09am
v3
Comments
OriginalGriff 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 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.

You can just swap the update statement like:
SQL
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
 
Share this answer
 
Comments
Member 9954101 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
Think about what you are saying:
SQL
if (status !=1) or (status !=2)
Show me a single value that fails that test. Did you mean AND rather than OR?
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900