CREATE or ALTER PROCEDURE test_sp @Employeename nvarchar(100)
AS
DECLARE @emp nvarchar(100)
SET @emp = (SELECT Employeename FROM Employees where Employeename=@Employeename)
IF @emp IS NULL
PRINT 'RUN SP'
ELSE
PRINT 'FOUND'
select @emp
GO;
exec test_sp 'test1'
AS
DECLARE @emp nvarchar(100)
SET @emp = (SELECT Employeename FROM Employees where Employeename=@Employeename)
IF @emp IS NULL
PRINT 'RUN SP'
ELSE
PRINT 'FOUND'
select @emp
GO;
exec test_sp 'test1'