Discussion:
How to execute SQL on a timer?
(too old to reply)
sherifffruitfly
2009-05-28 00:36:19 UTC
Permalink
Hi all,

I need to run a piece of sql (already written) upon the clock striking
MyFavoriteTime. It's just a select. After it runs, I need the results
emailed to MyFavoritePerson.

(Yes, I need this to eliminate the need for me to logon to work on
Sunday.)

How can I achieve this?

Thanks,

cdj
Aaron Bertrand [SQL Server MVP]
2009-05-28 01:38:30 UTC
Permalink
You could schedule a job using SQL Server Agent.

If you are using Express Edition (no Agent) then you could schedule
something via SQLCMD or PowerShell using Windows Task Scheduler. Or try out
Denny Cherry's standalone agent: http://www.codeplex.com/StandaloneSQLAgent


On 5/27/09 8:36 PM, in article
Post by sherifffruitfly
Hi all,
I need to run a piece of sql (already written) upon the clock striking
MyFavoriteTime. It's just a select. After it runs, I need the results
emailed to MyFavoritePerson.
(Yes, I need this to eliminate the need for me to logon to work on
Sunday.)
How can I achieve this?
Thanks,
cdj
sherifffruitfly
2009-05-28 18:42:56 UTC
Permalink
On May 27, 6:38 pm, "Aaron Bertrand [SQL Server MVP]"
Post by Aaron Bertrand [SQL Server MVP]
You could schedule a job using SQL Server Agent.
If you are using Express Edition (no Agent) then you could schedule
something via SQLCMD or PowerShell using Windows Task Scheduler.  Or try out
Denny Cherry's standalone agent:http://www.codeplex.com/StandaloneSQLAgent
On 5/27/09 8:36 PM, in article
Post by sherifffruitfly
Hi all,
I need to run a piece of sql (already written) upon the clock striking
MyFavoriteTime. It's just a select. After it runs, I need the results
emailed to MyFavoritePerson.
(Yes, I need this to eliminate the need for me to logon to work on
Sunday.)
How can I achieve this?
Thanks,
cdj
Setting up scheduled task with sql agent, using sp_send_dbmail now -
thanks for pointing me in the right direction!

Loading...