Have stored procedure some like this.
CREATE PROCEDURE test @ID @inventory bit = 0 @status nvarchar(2) = null AS BEGIN SELECT ID INVENTORY = (SELECT SUM(Inventory) FROM Option WHERE /*Inventory if 0 with if 1 without*/) STATUS WHERE --TODO Status if END how to create if statement when status can be null, '', 'preordered' for example: if null select all status, if '' select empty status, if some status - select some status. And need to create where condition for Inventory(with/without)