Use Utility;
GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.usp_SearchClient') AND type = 'P')
DROP PROCEDURE dbo.usp_SearchClient;
GO

CREATE PROCEDURE dbo.usp_SearchClient
 @f_name CHAR(50), @l_name CHAR(50)
AS
SET NOCOUNT ON

SELECT id_client
, first_name
, last_name
FROM ClientNULLNames
WHERE first_name = COALESCE(@f_name, first_name)
	AND last_name = COALESCE(@l_name, last_name)
ORDER BY last_name, first_name
GO

EXEC dbo.usp_SearchClient 'Maria', NULL

EXEC dbo.usp_SearchClient NULL, 'Adams'

EXEC dbo.usp_SearchClient 'Maria', 'Adams'

