public void Initialize() { using (var connection = new SqlConnection(ConnectionString)) { connection.Open(); var server = new Server(new ServerConnection(connection)); // get the database const string databaseName = "TransactionScopeTests"; Database transactionScopeTests = server.Databases[databaseName]; if (null != transactionScopeTests) { server.KillDatabase(databaseName); } transactionScopeTests = new Database(server, databaseName); transactionScopeTests.Create(false); using (SqlCommand sqlCommand = connection.CreateCommand()) { // ReSharper disable once AssignNullToNotNullAttribute sqlCommand.CommandText = Resources.CreateTables; sqlCommand.ExecuteNonQuery(); } } }