COmparing an Alphapet in Store Proc

  • Hi All,

        I am writing a store procedure where ineed to compare the alphabets available in2 different variables. Pls confirm whether it is correct.

    Both the Variables are Declared as CHar(1)

    set @status  = 'R'

    Set @Tol_status = 'U'

    can i do the Compare like this as said below or there ia any other way ?

    if(@Status = @Tol_Status)

    -- Do Manipulations

    Else

    -- Do Manipulations

     

  • Have you tried it? Many times it's pretty easy to mock up something simple to test code behaviours..

    declare @status char(1), @Tol_status char(1)

    set @status = 'R'

    Set @Tol_status = 'U'

    if(@Status = @Tol_Status)

      begin

     print 'Matches'

      end

    Else

      begin

      print 'No match'

      end

    /Kenneth

  • Also keep in mind collations and case sensitive/insensitive databases...if that matters!!!







    **ASCII stupid question, get a stupid ANSI !!!**

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

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