-
Notifications
You must be signed in to change notification settings - Fork 2
ClearTable
Darren Comeau edited this page Oct 14, 2018
·
3 revisions
Remove all rows of data from the table.
public int ClearTable(string schemaName, string tableName);
Parameters
schemaName
String
The database schema which hosts the object.
tableName
String
The name of the database table which we should delete data from.
Delete all the data held in a table.
// Setup the Database Tester object using the MS SQL implementation
var connectionstring = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=tempdb;Integrated Security=SSPI;";
VulcanAnalytics.DBTester.DatabaseTester tester = new VulcanAnalytics.DBTester.MsSqlDatabaseTester(connectionstring);
// Parameters for ClearTable method
var schemaName = "dbo";
var tableName = "TestPerson";
// Call the ClearTable method to delete all rows
tester.ClearTable(schemaName, tableName);
Intended for use with tables only.