How to use DTM Query Reporter for export query results to text file automation?

DTM Query Reporter is a tool that created for export results of the SQL query or script execution. It supports text (tab-delimited) and other formats like PDF, Windows HTML Help or XML document. The key product's feature is automation facility. The user creates a project file with GUI version of the tool and can run it again and again in the command line (unattended) mode. In other words, it can be used with scheduler, services or just batch file.

Download free demo version of the software and try it out.

There are steps to automate the text file with data creation:

DTM Query Reporter: export query results to text file sample
  • Establish a connection to the database system or desktop data file: the tool supports most popular connection methods and interfaces.
  • Enter SQL script or load it from a file. The program supports SELECT statements and stored procedure calls.
  • Specify output file name. The $DATE$ and $TIME$ macros can be used in the output file name.
  • Make command line with '-c' option. It switches the software to console mode.
  • Pass created command line to schedule system like: at 11:59 "c:\QueryReporter\qr.exe -c d:\SQL\RevenueQ2-2013.qrp"

The reporting tool offers a few features to customize the reporting process. Most important are:

  • SQL parameterization. The user enabled to use '?1', '?2', etc parameters as parts of the script. The program loads actual values from value file and generate the actual script before each execution.
  • Use custom report title.
  • Apply report localization.

See Also