A SQL task action is a really versatile way to make working with table data a more satisfying experience. Actions can be used to validate, backup or modify data and can be added as a button in the exTables editing area or to be executed on save.

Here are steps to create a basic validation action:

  1. Open the table you want to validate in exTables. Then go to the Table Designer and click Edit Actions.
  2. Add a new task by selecting the SQL Task.  Give the new task a name, a description and select the appropriate attributes.
  3. Set the SQL query to:
    update %TableName%  
    set __ValidationError = NULL
    update %TableName%  
    set __ValidationError = 'Below 100.000'  
    where [Price] < 100000  
  4. Automatically run when saving data property is handy for a validation script.
  5. Selecting In Parameters allows user to send custom parameter to the action.
  6. Click Run Action if you want to validate your data immediately.
  7. Click Save Tasks to save your action.