SP problem

  •  

    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

  • 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

     

  •  

    A small correction

    create proc MarriageStatus (@EPNAME VARCHAR(10), @status VARCHAR(3)

    AS

    BEGIN

    UPDATE EMPLOYEES

    SET STATUS=CASE WHEN  @status='YES' THEN 'Y' else 'N' end

    where

    emp_name=@EPNAME

    END 

    go

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply