Founder's blog

Simulating "jobs" in MS SQL Express

Dec 8 2009 :: by Alex
Another post for ASP.NET developers reading this blog. If you think these posts do not belong here, please leave a comment, and I'll consider moving my development articles to a separate blog.
As you might know MS SQL Server Express Edition does not include the SQL Agent service and, therefore, offers no jobs. So if you want to schedule, for instance, your backups, you... can't.

When we first started offering our Hosted Help Desk software to the public, we were running SQL Server Express to minimize our costs (we're self-funded, no VC). But we needed scheduled backups for the help desk database. I started looking for a solution and found a stupidly simple one: use "sqlcmd" along with the Windows Task Scheduler.

  1. Create an SQL script that you want to run periodically and save it to your hard-drive.
  2. Create a batch file like this:
    sqlcmd -i c:\folder\backup.sql
  3. Add a scheduled task that runs this bat-file
Say hi to your new job-system.

'Simulating "jobs" in MS SQL Express' was written by Alex by Alex. CEO, founder


comments