Simulating "jobs" in MS SQL Express
by Alex Yumashev ·
Dec 8 2009
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.
- Create an SQL script that you want to run periodically and save it to your hard-drive.
- Create a batch file like this:
sqlcmd -i c:\folder\backup.sql
- Add a scheduled task that runs this bat-file
Say hi to your new job-system.