Are instructions executed after END is completed in the stored procedure?
I found that the my stored procedure includes the delete procedure after the BEGIN / END block. However, every time I execute a stored procedure elsewhere in the code, it works fine and pvd_sp_yyy is not discarded. I'm not sure why? I worry about this in the first place, and so I'm going to remove the extra expression independently.
Does anyone have any ideas about this?
thanks
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER PROCEDURE [dbo].[pvd_xxx] @var AS BEGIN DECLARE @RETURN int SET @RETURN = 0 IF EXISTS ( SELECT * FROM table1 WHERE name = @var ) BEGIN SET @RETURN = 1 END RETURN @RETURN END IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pvd_sp_yyy]') AND type in (N'P', N'PC')) DROP PROCEDURE [pvd_sp_yyy]
bobbo source share