I need to create a SQL Server Function that will query a table based on 2 parameters. If no Data is found it needs to requery with a single parameter. Something like
I'm just not sure of the correct syntax to be able to do this.Code:Select apd from ipr where ipr.provid = @param1 and ipr.lob = @param2 If apd is null Then Select apd from ipr where ipr.lob = @param2 and ipr.provid is null return apd