I was asked this on an interview, and would like some feedback...
I have a stored procedure that takes in a varchar parameter IsActive that is either a "YES" or "NO" string.
The stored procedure will query a table that has an Active column with a datatype of bit. If the parameter is "YES" then it will return all rows with an Active column bit value of 1, otherwise for "NO" it will return all rows with an Active column bit value of 0.
Is it best to convert the parameter value from YES/NO to 1/0, or convert the table data from 1/0 to YES/NO when querying?
Is the answer the same if the datatypes are reversed (1/0 being passed in, YES/NO stored in the table)?