It would be better to use this syntax to check for existence:
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[foo]') AND type in (N'P', N'PC')) DROP PROCEDURE [dbo].[foo] GO
As written, if foo sproc was in any circuit, he would try to reset it. Not sure if this will make your problem go away. If you are using SSMS, there is a scripted stored procedure option like DROP and CREATE; this syntax should work.
source share