Command Line Examples

Example 1

The following example shows how to run any SQL query from the command line. It will open a file named updateStudents.sql and connect to the database using specified DSN, User Name, and Password. All error messages or any output data will go to output.txt file, and WinSQL Professional will close once the query has completed.

WinSQL "-dStudent DSN" –uAdmin –pAdmin –qc:\updateStudents.sql –oc:\output.txt -a

Example 2

The following example opens a file in the editor but does not run it.

WinSQL c:\student.sql

Example 3

 

The following example exports the data based on a template file called StudentTemplate.wet.

WinSQL –xStudentTemplate.wet -a

Notice that you do not have to provide a user id, password and DSN name when specifying a template file because this information is embedded in the template file. If you need to change any parameters in the template file, use the Export Template File Editor on the Tools menu.

Important notes for all examples

·There should not be any space between the option and its value.

·You can run only one SQL statement from the command line. If you have multiple statements separated by a terminator, errors may generate and the query will not run.