Job To Send Email Every Evening in SQL Server
I have figured out the sql statement to email information that I specify. What I cannot figure out is how to create a sql server job that will开发者_Python百科 send me this email at specific periods of time. Does anyone know how to do this?
In Management Studio:
- Open Object Explorer (F8).
- Connect to your server.
- Expand the server node.
- Expand SQL Server Agent.
- Right-click jobs, select New Job...
- Give the job a unique name.
- Go to the Steps tab.
- Click New...
- Give the step a name and enter your command (e.g.
EXEC someproc;
). - Click OK.
- Go to the Schedules tab.
- Click New...
- Give the schedule a name (e.g.
Nightly
). - Change "Frequency" to Occurs: "daily".
- Change "Daily Frequency" to Occurs once at: [desired time].
- Click OK.
- Click OK.
To make sure it works, you can right-click the Jobs node, select Refresh, then right-click the job you just created, and select "Start Job at Step..."
Create a new SQL Server job. Add a step to execute the SQL statement. Add a new schedule to run as you need. If you right-click the jobs in Management Studio, a rather self-explanatory GUI/wizard will open to create a new job.
精彩评论