I want to prepare a reuseable stored procedure to select a list of users base on several criteria, such as department or grade. If these information is not provided, all users should be returned. The stored procedure definition should look like this
CREATE STORED PROCEDURE spGetUsers @dept varchar(30), @grade varchar(30) BEGIN ... END
The stored procedure itself performs well, but when I would like to use it for Lookup rules in a case, where both @dept and @grade should be Null, I cannot do it as the _(DB.Null) option only appear once.
Furthermore, is it possible to assign a constant as a parameter when calling the stored procedure? Now, I need to create separate stored procedures for different scenarios?
Thanks