Run query on SSP database

From SMTX Wiki
Revision as of 21:44, 25 May 2020 by Smtxwiki (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This example is to show how SSP can run a query directly on the database using a command line action. From a form data is given into the process and within the process we execute a step of the type "Execute external application". We start a batch file and provide the query to be executed to the external application through a variable.

The content of the batch file is like this:

 
 @ECHO OFF
 echo %1 >> D:\Script\ExecutionLog.txt
 sqlcmd -U USERNAME -P PASSWORD -S SERVERNAME -Q %1 >D:\Script\result.txt
 ECHO ON
 @type D:\Script\result.txt