scheduled send mail task in SSIS - email

I have created a package in SSIS to fetch data from SQL Server table, then stored the result into an Excel destinationand and created a send email task .
How can i schedule the package to run automatically ? for example , every sunday at 11am ?

Save it out and run it in a sql job, then schedule the job for the day(s) and time(s) you need.

Related

Moodle: Scheduled tasks set for one minute sets itself to ASAP, but never reruns

I have been monitoring the Complete learning plans which are due task, which is set to run every minute. I have set the cron.php script with a password to force the cron job to run. When I reload the page I notice that the cron job runs, sets the next run date time, but doesn't run again and changes to ASAP.
I am using Moodle 3.6.3 on Windows IIS.
Create a task in task scheduler to execute the script after every minute (or any time you want). Use "Start a program" action. Replace "C:\Program Files\PHP\v7.2\php-win.exe" with your php version and also change the moodle path to yours.

Schedule single package from within SSIS package

I have a SQL job agent that has two job steps: PackageA and PackageB.
PackageB follows PackageA but PackageB should never run between 06:00 and 18:00.
Unfortunately, PackageA sometimes takes a long time causing PackageB to run between 6:00 and 18:00.
In PackageB I have a constraint+expression that checks whether the time is between 06:00 and 18:00. If so, PackageB exits nicely and sends an email to an operative reminding him/her to reschedule PackageB.
However, things would be very much better if I could have the package reschedule itself.
Logic in PackageB:
ExpressionTask --> fills variable #Hour with datepart("Hh",GETDATE())
If the found value is <6 or >18 the 'normal' procedure is executed or it starts an 'send email' and exits.
What I would like is to add a command after sending the email that would schedule PackageB to run once that same evening at 19:00. Ideally the procedure would check whether there is a job for just running packageB and schedule that to run once that evening at 19:00 and if there is no existing
job for running PackageB it should be created.
My feeling says this should be doable using TSQL. Any suggestions or are there better ways to do it besides using TSQL?
Thanx for thinking with me!
You can implement a T-SQL job step between PackageA and PackageB or a Execute SQL Task in SSIS that checks the time and uses the WAITFOR statement to wait till 19:00.
IF DATEPART(HOUR, SYSDATETIME()) >= 6 OR DATEPART(HOUR, SYSDATETIME()) < 18
BEGIN
WAITFOR TIME '19:00';
END;

How to call SQL Agent Job Wizard from PowerShell?

I need it to automate modification of SQL Server Scheduled jobs and want to reuse functionality of SSMS Scheduled job wizard.
Is it possible to popup SSMS Scheduled job wizard using PowerShell, use it and then close?
Update: I am aware of how to modify jobs using SPs and PS. The wizard is just one step in automated process. The next steps are to read the job settings and generate job script as per company's standard (that is important as out of the box Drop and Create script is not good enough), set encoding of the file etc.
You call a job via integrated MS SQL procedure sp_start_job. You call this SQL via Invoke-SqlCmd.
To modify/create the job you have to use sp_add_job, sp_add_jobstep, sp_update_job and sp_add_jobschedule.

Can Tableau Desktop be automatically refreshed when the database is updated

I'm using Tableau Desktop 9.0 to create a visualization by extracting the data from DB2 database. But this database is updated everyday. That is, at the every time the data in the database changes. So is it possible for me to schedule a task of refreshing the extracted data source automatically at specific interval of time so that, after updating the report should reflect the results accordingly. Can this be done through Tableau Desktop automatically? The main thing is that it can easily be done on Tableau Server as known. But I cannot afford for a Server so I'm trying to get an answer is it possible with the Tableau Desktop or not.
Use the Tableau Data Extract Command-Line Utility in a batch script (like DOS/cmd or PowerShell) and schedule the batch script to run on the Windows Task Scheduler.
Assuming you're using Windows. Use Task Scheduler to schedule (a variation of) the following Powershell script on a daily basis.
C:\Program Files\Tableau\Tableau 9.0\bin>tableau refreshextract--server
https://blah_blah_server_name --username YourServerSignIn --password
YourServerPwd --datasource "Some_Table" --source-username YourDatabaseSignIn
--source-password YourDatabasePassword

preferred pattern for conditional execution of a Talend job

I have a Talend job (call it A) that I want to run when an Oracle stored procedure (not executed by Talend) has completed. I have an Oracle control table that I can check to see if the Oracle SP has finished.
I am imagining having my Talend job A run on a schedule - perhaps every 15 minutes - and the first thing that it would do is determine if A has already executed today. If it has already run today it would stop execution immediately. If it has not yet run today, it will check to see if the Oracle SP has completed, and if not, it will stop execution immediately. This should result in Talend job A only executing once a day, and only after the Oracle SP has completed.
Is there a more elegant way to accomplish this?
Thanks.
As you've stated in the comments, Oracle SP has a CronJob.
You should make a Talend Job (A) which will be executed shortly after the Oracle SP start. This would have an Iterate + tOracleInput-tJavaRow + tRunJob + tJava
Iterate (i<=80 && somevalue==1 --> tOracleInput - row1 - tJava --
--IF--> row1.field.equals("true") --> tJava i = 101; --> tRunJob(JobB)
--IF--> !row1.field.equals("true") --> tJava Thread.Sleep(15*60*1000);
This way when you execute the JobB you'll exit from the loop. Also your Talend Job will run once a day, and does the calculation once a day. I know it seems to be a little dirty but it will work.
Having i set to 80 you'll end up with 81 trys thats 20hour 15min for the worst case not counting the query runtime.
Thread.Sleep accepts miliseconds thats why you need to multiply by 1000 to get the seconds and 60 to get the minutes
You can also think below options
1) export/build your talend job (A) as shell/batch file and execute it via same unix crontab job which executes your SP. You have to set dependency may be based on exit code of SP job.
OR
2) you can run your SP from talend job either using tOracleSP or even you can run your unix shell if any existing using tSystem and onSubJobOk run your talend job (A).