I want to use this SP with either having just 2 parameters like Patient Name, Patient LAst Namer or either Patient Name, Last Name, DOB or having the 4 all together.
Now, is working having mandatory all of 4, but the query would be having 2, 3 or 4.
What is the change that have to be done on this SP, thanks for your help.
ALTER PROCEDURE [dbo].[Get_Patients]
SET NOCOUNT ON;
select PatientID as Id, PatientName AS [Name],PatientLastName as [Last Name],PatientGender as Gender ,PatientDOB as [Date of Birth]
PatientName = @PatientName and
PatientLastName = @PatientLastName and
PatientGender = @PatientGender and
PatientDOB = @PatientDOB
ORDER BY PatientID