Page History
...
You should now have a fluidshell prompt similar to below
Set SQL Mode
FluidShell offers different modes which control how FluidShell interprets the commands you enter. Set the mode to "sql":
\cli sql
Connect to your Database
...
\change database northwind1
Enter Your SQL
...
DECLARE @today datetime set @today = DateAdd(dd, dateDiff(dd, 0, GetDate()),0) select * from dbo.Orders where ShippedDate < @today
Run the \sqlexport Command on the SQL Buffer Contents
...
\sqlexport -f csv -o /Users/s/Desktop/output.csv
Verify the CSV is Created Correctly and Save Your Commands
...
runfluidscript-bundled.bat "-cSQLServer" "-fC:\Users\s\Desktop\sqlexport.fs"
Schedule the runfluidscript-bundled.bat Execution
...
You can now use the OS scheduler to automate running of this csv file on a daily basis. To launch the Windows Task Scheduler choose Start > Control Panel > Administrative Tools > Task Scheduler. When it opens, expand the Task Scheduler Library in the pane on the left and right click to Create Task and give it a meaningful name and description.
If you do not plan on being logged in when the script should run, check your Security options and make sure that you choose to allow the script to run whether you are logged out or not and with the highest privileges as shown below.
In the Triggers tab set your trigger for once a day at your desired time.
In the Actions tab of Windows Task Scheduler choose Action: Start a Program, browse to select runfluidscript-bundled.bat from within the Aqua Data Studio installation location.
Use the -cSQLServer -fC:\Users\s\Desktop\sqlexport.fs
as arguments in the Actions details.
The -cSQLServer
indicates the registered server in your connections and the -fC:\Users\s\Desktop\sqlexport.fs
indicates the path to the FluidScript that contains all of your commands.
For "Start in", indicate the full directory path where Aqua Data Studio is installed and do not surround it with quotes.
Make sure you set the task to run once a day.
FluidShell also contains a sendmail command. Type \man sendmail to see the details of how this command works.
...