-
Notifications
You must be signed in to change notification settings - Fork 2
HasSchema
Darren Comeau edited this page Oct 14, 2018
·
3 revisions
Return true if the schema exists within the database.
public bool HasSchema(string schemaName);Parameters
schemaName String
The database schema which we want to check for the presence of.
// 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);Applicable for MS SQL, might not be applicable in all database implementations.