I have to stop my stored procedure in the middle when a if condition satisfies. i used NOEXEC ON it shows all the above results till NOEXEC ON STATEMENT. But i need only the if statement result without the above results is it possible.
DECLARE @var1 VARCHAR(MAX),
@var2 VARCHAR(MAX),
@var3 VARCHAR(MAX)
SET @var1 = 'ASH'
SET @var3 = 'ASHff'
print @var3
IF @var1 <> ''
BEGIN
PRINT 'Information available'
SET NOEXEC ON
END
SET @var2 = 'DFGF'
SET NOEXEC OFF
when i run it i got this result:
ASHff
Information available
but expected output is :
Information available
is it possible?