First of all, I did check hundreds of previous posts but I still have a problem. I have a T-SQL cursor. And I want to run this cursor every 5 minutes. In order to do that I've made a *.bat
file (sqlcmd -S DEAMON\SQLEXPRESS -i reminder_cursor.sql
) that runs it. Batch file and cursor file are both in the same folder (f.e. sql_cursor
) and they both have the same name (f.e. reminder_cursor.bat
, reminder_cursor.sql
). In taskschd
is:
General tab
When running the task, use the following user account: SYSTEM
don't want to see console windowrun with the highest privileges
tickedrun whether user is logged on or not
ticked
Triggers tab
begin a task on a schedule
Daily
recur every 1 day
Repeat task every 5 min for duration indefinitely
Enabled
ticked
Actions tab
Action: start a program
Program script
has exact path to thebat
fileStart in (Optional):
has exact path to the folder wherebat
file is stored
When I run the same bat
file manually, it works (every time). Next run time
goes forward, but doesn't run batch.