SQL Delta Logo
SQL Delta Banner

Add email to a command line project

Add email to a command line project

Postby david » Fri Apr 30, 2010 3:47 am

The easiest way to create a command line project is to use an existing project. Using SQL Delta GUI use or create a compare and run the structure compare and if required the data compare. This will configure your project and save you some typing.0x0A0x0AOnce the comparison is complete go back to the project tab and right mouse click your active project. You will need to “close up” the project to do this if you were editing or just created the project. Choose Display Project File to edit the project in Notepad. I recommend using save as in Notepad to create a command line copy of the project. This will ensure the SQL Delta GUI does not overwrite or alter your command line settings.0x0A0x0AGo to the end of file and before </Project> add the additional commands, in this case email.0x0A0x0A<Emails>0x0A <EItem>0x0A <Host>mail.host.com</Host>0x0A <User>support@host.com</User>0x0A <Password>Pass</Password>0x0A <To>support@host.com</To>0x0A <From>DeltaProcessor@host.com</From>0x0A <Body>Hello,0x0A Here is information from SQL Delta processing0x0A Regards0x0A </Body>0x0A <NotifyAlways>True</NotifyAlways>0x0A <Files>0x0A <FItem><Name>c: emp\myscript.sql</Name></FItem>0x0A </Files>0x0A </EItem >0x0A</Emails>0x0A0x0AIMPORTANT Last Steps0x0ASince command line processing is designed to either execute a change script or save a change script you must change the default script processing options. The command line process will fail if the default is not changed.0x0A0x0ALocate <Filename> inside the <Structure> section and either enter a path and filename to save the change script or below <Filename> change the <Execute> to True. For example:0x0A<Filename>c: emp\myscript.sql</Filename>0x0A<Execute>false</Execute>0x0A0x0AOf course having execute as true will apply any schema changes to your target. You will need to make the same changes to data (look for <Data>) if you want to run and report on a data compare. It is a good idea to use a different filename for Data.0x0A0x0ANow run SQL Delta adding the path and project filename as part of the command line, sometimes you will need to add quotes around the project text. When running SQL Delta does not output any screen information and the status of the processing is written to a log file in your standard SQL Delta folder. Look for CmdLog YYMMDD-HHMMSS.txt and if there was an error CommandLineErrors.txt. Errors are appended to CommandLineErrors so you may wish to delete the file before processing.0x0A0x0ANotes:0x0AYou must enter your own mail details and the email is sent using SMTP. For more options see the help file.0x0AAlso see the help file for more information about variable filenames. Of course when doing this yourself enter a valid path.
david
Site Admin
 
Posts: 423
Joined: Mon Nov 10, 2003 11:22 pm

Return to Command Line