Rajdeep Debnath
Old Hand
Points: 307
More actions
January 24, 2007 at 11:55 pm
#175692
Hi
I have a field 'Status' that can contain two kinds of data 'Y' or 'N'. Now I want to send 'Yes' when it is 'Y' and 'No' when 'N' through SP. Could you please give me any solution?
Regards,
Rajdeep
johncyriac
SSCommitted
Points: 1542
January 25, 2007 at 12:18 am
#685430
create proc MarriageStatus (@EPNAME VARCHAR(10), @STATUS VARCHAR(3)
AS
BEGIN
UPDATE EMPLOYEES
SET STATUS=CASE WHEN @STATUS='YES' THEN 'Y' else 'N'
where
emp_name=@EPNAME
END
go
exec MarriageStatus 'Rajdeep' ,'N'
send more time on T-Sql
regards
john
January 25, 2007 at 12:20 am
#685431
A small correction
SET STATUS=CASE WHEN @STATUS='YES' THEN 'Y' else 'N' end
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply