I have a SQL Server 2008 R2 database with a stored procedure that may or may not exist.
If I run sp_help spThing , it returns the string as if it existed (Name: spThing, Owner: dbo, Type: stored procedure).
If I try to create a new stored procedure with the same name, I get the error message "There is already an object with the name" spThing "in the database.
BUT
If I run SELECT OBJECT_ID('dbo.spThing') , it returns NULL.
If I run EXEC spThing , it says: "Could not find the stored procedure" spThing ".
If I run DROP spThing , he says: "It is not possible to refuse the spThing procedure because it does not exist or you do not have permission."
If I run SELECT * FROM sys.objects WHERE name = 'spThing' , I do not get the string.
If I run SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME = 'spThing' , I do not get the line.
All of them were started from the same connection as the administrative user.
Is there a stored procedure?
Edit:
SP itself is a trivial row choice:
CREATE PROCEDURE spThing @Param int AS BEGIN SELECT strThing FROM tblThing WHERE lngParam = @Param; END
source share