Stored procedure will run all available unit tests in a database. At the beginning this procedure will refresh list of available unit tests in the database and execute global setup process, at the end, when all test are complete it will also run global teardown functions to perform cleanup.


  • v_UseTransaction   - wraps each individual unit test execution in to a transaction. Default is 0. SQL Server only feature. 


Transaction support

  • Transactions are supported in Oracle and SQL Server versions of the framework, Netezza does not support transactions at this time. 
  • When v_UseTransaction flag is set to 1 test runner will wrap each individual Unit Test into a transaction, and will rollback any changes made by the test after execution. When v_UseTransaction flag is set to 0 (default value) runner will not use transactions. This behavior can be overwritten by DBTD_USE_TRANSACTION and DBTD_DO_NOT_USE_TRANSACTION hint procedures.
  • When transaction is used, test runner does not execute teardown functionality instead it assumes that transaction will clean up all the changes.
  • Using transaction feature can be impacted by user’s code and might interfere with transaction logic codded in your scripts. If you run in to situations like this try to test your code without transaction enforcement until you are satisfied, and then try to turn transactions on again.



SQL Server

      EXEC DBTD_RUNTESTS @v_UseTransaction = 1;






See Also