SQL Server – Error While Creating Stored Procedure

sql serversql-server-2008

I'm trying to create a stored procedure. Once I created it, it was successfully created. But it is not displaying in the list of stored procedures. I refreshed the list, but it is not appearing. I also tried to recreate it, but there was an error:

Msg 2714, Level 16, State 3, Procedure spProducts_DeleteProduct, Line 6
There is already an object named 'spProducts_DeleteProduct' in the database.

enter image description here

What is the reason behind not seeing that stored procedure in the list?

Best Answer

You need to run ALTER PROCEDURE to change a stored procedure definition. See docs here.

You also need to make sure you're using the correct database. I bet if you look in master, it'll be there.

In the meantime, put USE [YourDatabaseName] at the top of your code.