• Hey there...

    So you are saying that if I have the following “validation” code at the beginning of my SP (after variable declaration and before INSERT)_, that I should be using COALESCE instead of IS NULL:

    Note: @PatientHospitalID VARCHAR (10), @GenderID INT

    --Excerpts from code

     SELECT @PatientHospitalID = LTRIM(RTRIM(@PatientHospitalID))

     IF @PatientHospitalID IS NULL

      SELECT @PatientHospitalID = 0

     SELECT @GenderID  = LTRIM(RTRIM(@GenderID))

     IF @GenderID IS NULL --needs to have a valid value!

      SELECT @GenderID  =3  --3 = UNKNOWN

    Just wondering

     

    Thanks.

    Michelle/Dolphin.

    "Work like you don't need the money;
    dance like no one is watching;
    sing like no one is listening;
    love like you've never been hurt;
    and live every day as if it were your last."
    ~ an old Irish proverb