How to add a new stored procedure?

Sun_Force

Active member
Local time
Today, 19:29
Joined
Aug 29, 2020
Messages
396
My first attempt for a stored procedure.
The context menu when I right click Stored Procedures doesn't contain New Stored Procedure.

Is it normal?
Is there any other way to add a new stored procedure?

This is the same for system databases as well as local databases.

SQL Server Express 2019
Sql Server Management Studio 8.1


Any kind of help is much appreciated.

2021-11-26_14-33-39.jpg
 
you try it first, it will show you the new stored proc template.
is "master" your default db (you did not create any?).

there are many samples on the net.
 
you try it first, it will show you the new stored proc template.
is "master" your default db (you did not create any?).

there are many samples on the net.
Thanks for your help.

Selecting the first item (Stored Procedure....) brings up a new query window with a template.
When I save and close it, it doesn't appear in the list in Object Explorer.

I refreshed, restarted the server, closed and opened management studio, but it doesn't appear there.
If I attempt to run the stored procedure, I receive an error that it can not be found.

master is not the only database. I have two other databases. But the stored procedure I'm adding, will be used to schedule a backup.
According to Microsoft Docs, it should be under master.

 
did you Execute it?
if you did. refresh master db.
the expand it again.

you will see this:
Inkedsp_backup.jpg
 
Last edited:
That's because you are in the system master database, and probably don't have privileges for that?

Try it under the database you are connecting to. If that doesn't work it will probably be an access rights issue.
 

Users who are viewing this thread

Back
Top Bottom