2

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?

  • 2
    Looks like you're trying to create the procedure in the master DB is that your intent? – AMtwo Apr 6 '17 at 15:27
1

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.

1

Drop procedure you created and try

use [Database]
Go
Create procedure  spProducts_DeleteProduct

Hope it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.