I have the below Stored proc which passes in the field name and values to filter on. It works great. However, some of the columns are of type int and others are varchar. The varchar columns need the values in quotes, but the int columns do not. Therefore the below only works for varchars.
Is there any easy fix? Thanks
CREATE PROC test
FROM DESK D,
WHERE ' + @columName + ' LIKE ''' + @value +'''
AND I.id_desk = D.id_desk' )