Skip to content

DropTable

Darren Comeau edited this page Oct 11, 2018 · 1 revision

DropTable(String, String)

Remove the table from the database

Overloads

public int DropTable(string schemaName, string objectName);

DropTable(string schemaName, string objectName)

Parameters

schemaName String

The database schema which hosts the object.

objectName String

The name of the database table which we should drop.

Examples

Drop 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 DropTable method
var schemaName = "dbo";
var tableName = "TestPerson";

// Call the DropTable method to remove the table
tester.DropTable(schemaName, tableName);

Remarks

Intended for use with tables only.