How to find the Count of Columns (unique fields) per HEAT table

Version 1

    Details

    What is the SQL query to identify the Count of the number of columns or unique named fields for the HEAT call ticket tables?


    Resolution

    Run the following queries in SQL Management Studio to the HEAT database.

    SELECT COUNT(DISTINCT FLDName) AS CallLogColumns FROM HEATFld WHERE TableName = 'CallLog'

    SELECT COUNT(DISTINCT FLDName) AS SubsetColumns FROM HEATFld WHERE TableName = 'Subset'

    SELECT COUNT(DISTINCT FLDName) AS AsgnmntColumns FROM HEATFld WHERE TableName = 'Asgnmnt'

    SELECT COUNT(DISTINCT FLDName) AS DetailColumns FROM HEATFld WHERE TableName = 'Detail'

    SELECT COUNT(DISTINCT FLDName) AS JournalColumns FROM HEATFld WHERE TableName = 'Journal'