Skip to main content

Writing a script to configure connector behavior

You write a script file to define SQL commands used in the interaction between the agtsqlscript connector and the SQL Server database. A sample script, agtsqlscript . cfg is contained in the samples directory. Note that any sample script may need customizations in order to work with your system.

Learn about writing script files for SQL application connectors.

Using Transactions

A script for targeting a SQL Server hosted application can use transactions to commit work only if all SQL statements are successful.

A key-value of "usetransaction" enables or disables the use of transactions. The key-value "usetransaction" is available to each operation KVGroup and is either true or false.

For example:

   "m-tech:agents:sqlscript" "1.1" = {
     "operation" "reset" = {
       ...
       "usetransaction" = "true"
       ...
     }
   ...
   } 

Executing SQL statements at block level

When the connector encounters any errors in an operation which contains multiple blocks, it is able to proceed to run following SQL blocks by enabling "proceedblocks". By default this is disabled.

This flag only applies to the operations that involve changing, which include: rename, updatesubscriber, change, verifyreset, reset, lock, unlock, enable, disable, resetexpirepw, expirepw, unexpirepw, expireacct, unexpireacct, delete, groupuseradd, groupuserdelete, groupgroupadd, groupgroupdelete.

A key-value of "proceedblocks" enables or disables the use of proceeding at block level. The key-value "proceedblocks" is available to each operation KVGroup and is either true or false.

For example:

  "m-tech:agents:sqlscript" "1.1" = {
     "operation" "delete" = {
       ...
       "proceedblocks" = "true"
       ...
     }
   ...
   }