private void dropOldTables(CopyTable table) throws SQLException
	{
		LOG.info("Dropping older versions of table '" + table.getToName() + "'...");
		
		Statement q =
			CopyToolConnectionManager.getInstance().getMonetDbConnection().createStatement();
		
		ResultSet result =
			q.executeQuery("SELECT name FROM sys.tables WHERE name LIKE '" + table.getToName()
				+ "_20%_%' AND name <> '" + table.getToName() + "' "
				+ "AND schema_id = (SELECT id from sys.schemas WHERE name = '" + table.getSchema()
				+ "') AND query IS NULL ORDER BY name DESC");
		
		int i = 0;
		int dropCount = 0;
		Statement stmtDrop =
			CopyToolConnectionManager.getInstance().getMonetDbConnection().createStatement();
		while(result.next())
		{
			i++;
			
			// if table is a fast view-switching table then
			// 		skip first result -> is current table and referenced by view
			// 		skip second result -> as backup (TODO: perhaps make this configurable?)
			if (table.isUseFastViewSwitching())
				if (i == 1 || i == 2)
					continue;
			
			// build DROP query
			StringBuilder query = new StringBuilder("DROP TABLE ");
			
			if (!StringUtils.isEmpty(table.getSchema()))
				query.append(MonetDBUtil.quoteMonetDbIdentifier(table.getSchema())).append(".");
			
			query.append(MonetDBUtil.quoteMonetDbIdentifier(result.getString("name"))).append(";");
			
			// execute DROP query
			stmtDrop.executeUpdate(query.toString());			
			dropCount++;
		}
		
		if (i == 0 || (table.isUseFastViewSwitching() && i <= 2))
			LOG.info("Table '" + table.getToName() + "' has no older versions");
		else
			LOG.info("Dropped " + dropCount + " older versions of table '" + table.getToName() + "'");
		
		result.close();
		q.close();
	}