DataDict Parse (v1.2).sql - 10/02/2025 - The GoldMine DataDict.xml parsing SQL query.
Purpose: For many years I have been trying to automate GoldMine database corruption detection via SQL queries. One of the things standing in my way had been figuring out how to parse the GoldMine DataDict.xml file into a useful temporary table where it could then be compared to the existing GoldMine database. This query is a first step in that direction.
Results: Return shows all tables, fields and indexes defined in DataDict.xml, plus all tables, fields and indexes that exist in GoldMine, with their associated information. Indication is provided if the table or field exists in Datadict or GoldMine.
Version: 1.0 - 09/30/2025 - Initial Release
Version: 1.1 - 10/01/2025 - Added GoldMine SQL tables that don't exist in DataDict.xml to output. These are custom tables added by the user which would be unknown to GoldMine. Flagged as TableExists="GoldMine Only".
- Removed some leftover debugging code.
- Added a few commented filters
- Changed default filter to show only "odd" tables and fields.
Version: 1.2 - 10/02/2025 - Output structure change. TableExists and ColumnExists have changed to "InDataDict" and "InGoldMine", with their meaning being adjusted to the obvious.
- Added the same logic to the Index rows for InDataDict and InGoldMine. We now see missing or extra indexes in either DataDict.xml or GoldMine. We do NOT check the index structure for differences because there are almost ALWAYS differences. The DataDict might just say "ACCOUNTNO + RECID", where in SQL, GoldMine has created it as "ACCOUNTNO ASC + recid ASC". Because GoldMine is adding the sort order without defining it in DataDict, we can't reliably flag indexes that are worth further scrutiny.
- Added info about the sysdiagrams "system" table showing up as a GoldMine table. There's a filter fragment at the end to hide sysdiagrams if desired.