Where the !@?!@ is my Stored Procedure?



Hi,

I wrote the following in the SQL Server 2005 Express Management Studio
Query Analyzer
and hit execute. Even though Query Analyzer indicated success when I
hit refresh on the stored procedure folder the procedure does not show
up in the stored procedure list. When I entered 'exec Test' I get an
error indicating that SQL Server 2005 can't find the procedure. I
executed the following code 'select * from sys.all_objects where name
like '%Test%'' and the object is not in the returned result. So I tried
to execute the code again, and lo and behold, SQL Server gives me the
following error - There is already an object named 'Test' in the
database. What the hell?

Thanks,
Frustrated

-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE dbo.Test
-- Add the parameters for the stored procedure here
--<@Param1, sysname, @p1> <Datatype_For_Param1, , int> =
<Default_Value_For_Param1, , 0>,
--<@Param2, sysname, @p2> <Datatype_For_Param2, , int> =
<Default_Value_For_Param2, , 0>
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
-- SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>

-- blah, blah
END
GO

.



Relevant Pages

  • Re: Different version of SQL Server returns different Result
    ... > I have a stored procedure that is created and located at SQL Server 6.5. ... When the stored procedure's result is invalid, it will return NULL, else it ... > The problem is, when I tried to execute it at Query Analyzer for SQL 2000, ...
    (microsoft.public.sqlserver.programming)
  • Re: Hostname change and SQL problem.
    ... Execute the statement in Query analyzer if SQL SERVER is normal edition, ... it is MSDE from command prompt execute ... from the local SQL Server. ...
    (microsoft.public.sqlserver.connect)
  • Re: Error 14113 while trying to setup replication on SQL Server 2000 S
    ... Can you try to run command shell from within query analyzer? ... Looking for a SQL Server replication book? ... Error 14113: Could not execute c:\... ...
    (microsoft.public.sqlserver.replication)
  • Re: Loading an external DLL
    ... Create a DLL ... Execute the following in Query analyzer to register the function i SQL ... The following command could be useful if SQL Server doesn't release the DLL. ...
    (microsoft.public.sqlserver.programming)
  • Re: Execute Persmission denied on object sp_OACreate
    ... > SQL Server is creating a job behind the scenes. ... > permissions. ... > SA account password and gaining access to the database. ... >>> How can get a user permissions to execute these stored procedures ...
    (microsoft.public.sqlserver.security)