Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disappearing Stored Procedure

So, not sure what is happening. But I have stored procedure and it keeps disappearing out of my DB in SQL 2k.

I can add it again and then try to execute it from my web app and i get an exception saying the stored procedure cant be found. So then ill go back to management and refresh and its gone again !?!

here is the config for the stored proc:

set ANSI_NULLS OFF
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[USP_Equipment_Delete]
    @EquipmentID int
AS

DELETE FROM [dbo].[Equipment]
WHERE
    [EquipmentID] = @EquipmentID

None of my other stored procedure disappear. This is the only one. I have easily 100 in there. They all use the same SQLHelper class. This one just keeps disappearing!!!??!!

Any help or suggestions are appreciated!

Thanks so much!

like image 528
Gabe Avatar asked May 13 '09 15:05

Gabe


1 Answers

You were creating this or another stored proc and at the end of your code, maybe after a comment, where you did not see it you have a drop of this proc.

Take a look at your db using:

select syo.name
from syscomments syc
    join sysobjects syo on
        syo.id = syc.id
where syc.[text] like '%DROP PROC%'
like image 118
Peter Avatar answered Sep 19 '22 14:09

Peter