I’m working in sql server 2005 here and I wanted to know if there was a way to make a stored procedure take variable a or variable b for its parameters.
Right now if I declare A and B it requires both A and B. Possible to make it take A or B instead? So that if the other one doesn’t have a value it uses the other?
ex:
@ID VARCHAR(255)
@MAKE VARCHAR(255)
AS
BEGIN
SET NOCOUNT ON
SELECT *
FROM CARS
WHERE ID = @ID OR MAKE =@MAKE
Thanks!
1 Answer