Data Manipulation on Tables

The following commands are only available on a Sql Server instance.
  • table-reset: this command will let you delete all the rows of a table (truncation).
  • table-load: this command will let you fill a table on base of a csv file (bulk load). The xml attribute named file expects the name of the csv file to load.
For all of them, The xml attribute named name expects the name of the table to reset.

<setup>
	<table-reset  name="NewUsers"
		connectionString="..."/>
	<table-load   name="NewUsers"
		file ="NewUsers.csv"
		connectionString="..."/>
</setup>

If you want, you can also reference a connection-string in the xml attribute connectionString. If you want to avoid to repeat this connection-string within all your commands, you can create a default value for the connectionString in the settings at the top of your test-suite. the apply-to value must be set to to setup-cleanup.

<settings>
	<default apply-to="setup-cleanup">
		<connectionString>Data Source=(local)\SQL2012;Initial Catalog=AdventureWorksDW2012;Integrated Security=true</connectionString>
	</default>
</settings>

Last edited Oct 6, 2014 at 8:27 PM by Seddryck, version 2

Comments

No comments yet.