0

Servers are SQL Express - about 160 instances. What I need is to execute various scripts(clean tables, backups etc.) on them automatically several times a day. I do not want to use standard Windows Scheduler, as it sometimes just doesn't work. I am looking for a solution maybe free maybe not. Free preferably.

4
  • 2
    Express doesn't come with Agent, which is what you'd normally use, so your options are Batch Scripts or something similar external to SQL Server. Side note, this question will undoubtedly be closed because it isn't about programming so you may want to check our dba.stackexchange.com Commented Nov 23, 2016 at 14:04
  • The question is what tool to use to start this external Commented Nov 23, 2016 at 14:29
  • Yes... but it's opinion based and off topic. See #4 here: stackoverflow.com/help/on-topic Your questions should be MCVE, which you can read about here: stackoverflow.com/help/mcve Commented Nov 23, 2016 at 14:38
  • IMO you should preferebly focus on solving problem you descibed as "Windows Scheduler sometimes just doesn't work" instead of searching for workarounds. Batches launched from Windows Scheduler are preferable choice. If there is some problem with them, work on identifying the problem. Commented Dec 31, 2016 at 13:15

1 Answer 1

1

I think you will need to run a batch script to get things done.

For the benefit of all, here's a Delete.bat

ECHO Executing Job
ECHO.
PAUSE
sqlcmd -S "london-sql\sqlexpress" -E -Q "exec London.dbo.DeleteAll"
ECHO Job execution Completed
PAUSE
CLS
EXIT

(‘london-sql\sqlexpress’ is the name of the server)

The Load.dat is almost identical, except '"exec London.dbo.LoadAll"'

Call the batch script with Windows Scheduler.

http://www.howtogeek.com/school/using-windows-admin-tools-like-a-pro/lesson2/all/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.