Running a stored procedure from Windows Task Scheduler

Rightclick in the Scheduled Tasks area and choose "New" -> "Scheduled Task". Then in the run field add the following:

sqlcmd -S .\SQLExpress -i c:\expressmaint.sql

In the sql file you can simply write: EXEC dbname.dbo.sp_AnyStoredProcedure.

Why don't just use SqlAgent you may ask. In SqlExpress the SqlAgent has been feature cut - because express is free.

↓ 1 comment
↓ Add Comment

Comments (1)

Brad said March 4, 2008 04:22 PM

Or you could run a stored procedure directly from the task scheduler VisualCron -> http://www.visualcron.com