Query to determine 'How many records in each GoldMine table within a SQL database' which can be used from within GoldMine SQL Query pane

Version 2

    Details

    Query to determine 'How many records in each GoldMine table within a SQL database' which can be used from within GoldMine SQL Query pane.


    Resolution

    [STEPS]
    1. Tools > SQL Query
    2. Copy and paste the following query (also attached for download) into the Query pane

    SELECT
    (SELECT COUNT(1)  FROM CAL) AS CAL
    ,(SELECT COUNT(1)  FROM CALDEF) AS CALDEF
    ,(SELECT COUNT(1)  FROM CAMITEMS) AS CAMITEMS
    ,(SELECT COUNT(1)  FROM CAMPAIGNS) AS CAMPAIGNS
    ,(SELECT COUNT(1)  FROM CASEATTACHMENT) AS CASEATTACHMENT
    ,(SELECT COUNT(1)  FROM CASECONTACTSLINK) AS CASECONTACTSLINK
    ,(SELECT COUNT(1)  FROM CASEINFOLINK) AS CASEINFOLINK
    ,(SELECT COUNT(1)  FROM CASES) AS CASES
    ,(SELECT COUNT(1)  FROM CASETEAMLINK) AS CASETEAMLINK
    ,(SELECT COUNT(1)  FROM CONTACT1) AS CONTACT1
    ,(SELECT COUNT(1)  FROM CONTACT2) AS CONTACT2
    ,(SELECT COUNT(1)  FROM CONTGRPS) AS CONTGRPS
    ,(SELECT COUNT(1)  FROM CONTHIST) AS CONTHIST
    ,(SELECT COUNT(1)  FROM CONTSUPP) AS CONTSUPP
    ,(SELECT COUNT(1)  FROM CONTTLOG) AS CONTTLOG
    ,(SELECT COUNT(1)  FROM CONTUDEF) AS CONTUDEF
    ,(SELECT COUNT(1)  FROM CUSTDATASOURCE) AS CUSTDATASOURCE
    ,(SELECT COUNT(1)  FROM CUSTRELATIONS) AS CUSTRELATIONS
    ,(SELECT COUNT(1)  FROM CUSTVIEW) AS CUSTVIEW
    ,(SELECT COUNT(1)  FROM ENVIRONMENT) AS ENVIRONMENT
    ,(SELECT COUNT(1)  FROM FIELDS5) AS FIELDS5
    ,(SELECT COUNT(1)  FROM FILTERS) AS FILTERS
    ,(SELECT COUNT(1)  FROM FORMS) AS FORMS
    ,(SELECT COUNT(1)  FROM FORMSFLD) AS FORMSFLD
    ,(SELECT COUNT(1)  FROM FORMSQUE) AS FORMSQUE
    ,(SELECT COUNT(1)  FROM GMTLOG) AS GMTLOG
    ,(SELECT COUNT(1)  FROM GOOGLEEVENT) AS GOOGLEEVENT
    ,(SELECT COUNT(1)  FROM GSFILTER) AS GSFILTER
    ,(SELECT COUNT(1)  FROM GSLOGS) AS GSLOGS
    ,(SELECT COUNT(1)  FROM GSSERVER) AS GSSERVER
    ,(SELECT COUNT(1)  FROM GSSITES) AS GSSITES
    ,(SELECT COUNT(1)  FROM HISTORY) AS HISTORY
    ,(SELECT COUNT(1)  FROM HISTORY_ITEM) AS HISTORY_ITEM
    ,(SELECT COUNT(1)  FROM IMPEXP) AS IMPEXP
    ,(SELECT COUNT(1)  FROM INFOMINE) AS INFOMINE
    ,(SELECT COUNT(1)  FROM LEADDBFS) AS LEADDBFS
    ,(SELECT COUNT(1)  FROM LEADDIST) AS LEADDIST
    ,(SELECT COUNT(1)  FROM LEADFILE) AS LEADFILE
    ,(SELECT COUNT(1)  FROM LOOKUP) AS LOOKUP
    ,(SELECT COUNT(1)  FROM MAILBOX) AS MAILBOX
    ,(SELECT COUNT(1)  FROM NOTES) AS NOTES
    ,(SELECT COUNT(1)  FROM OPMGR) AS OPMGR
    ,(SELECT COUNT(1)  FROM OPMGRFLD) AS OPMGRFLD
    ,(SELECT COUNT(1)  FROM PALMSLOG) AS PALMSLOG
    ,(SELECT COUNT(1)  FROM PALMSSS) AS PALMSSS
    ,(SELECT COUNT(1)  FROM PERPHONE) AS PERPHONE
    ,(SELECT COUNT(1)  FROM REPORT32) AS REPORT32
    ,(SELECT COUNT(1)  FROM REPORTTEMP) AS REPORTTEMP
    ,(SELECT COUNT(1)  FROM RESITEMS) AS RESITEMS
    ,(SELECT COUNT(1)  FROM SCRIPTSW) AS SCRIPTSW
    ,(SELECT COUNT(1)  FROM SPFILES) AS SPFILES
    ,(SELECT COUNT(1)  FROM SYNCLOCK) AS SYNCLOCK
    ,(SELECT COUNT(1)  FROM SYNCTASK) AS SYNCTASK
    ,(SELECT COUNT(1)  FROM SYSLOG) AS SYSLOG
    ,(SELECT COUNT(1)  FROM SYSREPS) AS SYSREPS
    ,(SELECT COUNT(1)  FROM TABLEDEF) AS TABLEDEF
    ,(SELECT COUNT(1)  FROM TRACKS) AS TRACKS
    ,(SELECT COUNT(1)  FROM USERLOG) AS USERLOG
    ,(SELECT COUNT(1)  FROM USERS) AS USERS

    3. Query

    [RESULTS]



    4. If necessary > Right Click > Output to > Excel, Word or the Clipboard



    5. If required use the Microsoft Excel 'Copy in Transpose format' in order to get the results in rows instead of columns