Skip to content

HasSchema

Darren Comeau edited this page Oct 14, 2018 · 3 revisions

HasSchema(String)

Return true if the schema exists within the database.

Overloads

public bool HasSchema(string schemaName);

HasSchema(string schemaName)

Parameters

schemaName String

The database schema which we want to check for the presence of.

Examples

// 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 HasSchema method
var schemaName = "dbo";

// Call the HasSchema method to check presence of schema
var hasSchema = tester.HasSchema(schemaName);

Assert.IsTrue(hasSchema);

Remarks

Applicable for MS SQL, might not be applicable in all database implementations.

Clone this wiki locally