Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to generate the Task Scheduler commands for SQL Express #796

Open
mdell-seradex opened this issue Feb 22, 2024 · 0 comments
Open

Comments

@mdell-seradex
Copy link

mdell-seradex commented Feb 22, 2024

The current script can create SQL Agent Jobs that execute T-SQL commands.
It first creates them in an @Jobs table variable, and then creates the Jobs from that data.
It would be nice if, for SQL Express, it could generate (or update) the .cmd or .bat script files, from those commands.
It would be even better if it created powershell commands to create Task Scheduler tasks for those. This would also allow your maintenance script to control the default timing of the commands.

It would also be nice if we could choose to combine commands into groups such that the commands in a group would be executed sequentially, but that is probably asking for too much. If this were to be added, then naming may become an issue.

I setup these commands for an instance of SQL Express just recently. To do this, I manually adjusted the primary script to create the data in the @Jobs table variable, and then pushed it into a real table. I next proceeded to use that data to manually create the batch files and Task Scheduler steps.
I found that this was easier to do, instead of trying to read through all the documentation and create those commands myself.

It may have been even simpler had I created stored procedures to run the command batches. That is an approach that could be taken, and may make updating them simpler.

Thank you,
Mark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant