TSTool / Command / DeleteDataStoreTableRows
DeleteDataStoreTableRows command deletes rows from a database
datastore table by using one of the following methods:
- Execute an
SQL DELETEstatement to delete all rows. Currently, only the ability to delete all rows is supported (see
DeleteAllRows=Truecommand parameter). In the future functionality will be implemented to delete specific rows using an
SQL WHEREclause. See also the
RunSql()command, which can be used to execute any SQL statement on a database datastore.
- Execute an
SQL TRUNCATEstatement (see
DeleteAllRows=Truncate). Although database software varies, this typically has the effect of resetting auto-number counters.
If database datastore support is not specifically provided by TSTool,
a generic datastore can be used (see the
Generic Database DataStore appendix).
This command cannot be used with web service datastores and use with Excel datastores has not been tested.
This command is useful in particular for bulk data processing such as to
delete records in a table before (re)loading in bulk (see
General constraints are as follows:
- the table or views being processed must be writeable by the user specified for the database connection (some databases restrict direct access to data and/or require using stored procedures)
The following dialog is used to edit the command and illustrates the syntax of the command.
DeleteDataStoreTableRows Command Editor (see also the full-size image)
The command syntax is as follows:
|The name of a database datastore to process.||None – must be specified.|
|The name of the database table or view being processed.||None – must be specified.|
||Indicate whether all rows should be deleted:
See the automated tests.