February 22nd, 2000, 11:11 AM
I need to write a stored procedure to retrieve data from a table passing combinations of parameters.
Example
create procedure name
@ssn,@lname,@fname,@dateofbirth,@hiredate(etc)
select all related information for a particular employee
from table
where ssn = @ssn and lname = @lname when i pass first two parametes only.
like that i have to pass different combinations to get the same data.
I wrote this stored procedure by using if conditions but it looks pretty lengthy.
Is there any way to shorten the code.
Thanks in advance
Example
create procedure name
@ssn,@lname,@fname,@dateofbirth,@hiredate(etc)
select all related information for a particular employee
from table
where ssn = @ssn and lname = @lname when i pass first two parametes only.
like that i have to pass different combinations to get the same data.
I wrote this stored procedure by using if conditions but it looks pretty lengthy.
Is there any way to shorten the code.
Thanks in advance