Skip to content

Object Usage Report ​

Info Snapshot analysed 206 tables · 102 views · 516 procedures · 8 functions (from schemas/, daily export of the live database). Generated 2026-07-10 by scripted analysis of the JSON snapshots.

Method ​

  • View → table references were taken from each view file's dependencies array, matched case-insensitively against table names.
  • Procedure → table references were found by searching each procedure's definition SQL for the table name as a whole word (case-insensitive).
  • Broken references were found by extracting FROM / JOIN / INSERT INTO / UPDATE / DELETE FROM / EXEC dbo.<name> patterns (explicit dbo. prefix only, comments stripped) and checking the name against every known table, view, procedure and function in the snapshot.

Warning Caveats

  • Name matching cannot see dynamic SQL (strings built and passed to sp_executesql), so usage counts are lower bounds and "orphan" is not proof a table is unused.
  • Usage from outside the database (application code, SSRS, Power BI, agent jobs, external ETL) is invisible to this analysis. Staging tables written by integrations may legitimately show zero references.
  • A whole-word match on a table name inside a procedure counts comments and string literals as references, so procedure counts can be slightly inflated.
  • The broken-reference scan only checks two-part dbo.-qualified names; unqualified references to missing objects are not flagged (the unqualified scan produced too many alias false positives to be reliable).

1. Orphan tables ​

Tables referenced by no view and no procedure in the snapshot — 25 of 206. Sixteen are explicitly deprecated or temporal-history artefacts; the other nine (bold) deserve a closer look before being written off.

TableNotes
A&GPredefinedEstimateItemsLookup/import data; possibly used only by app code
EthAppointmentConfig_DepcreatedDeprecated
EthNonPrefinedItemsLookup/import data
EventLog_DeprecatedDeprecated
MSSQL_TemporalHistoryFor_731865674System-generated temporal history table
PB_DateDimPower BI date dimension — likely consumed directly by Power BI
PredefinedEstimateItemsLookup/import data
PrimeAccountsPayableInvoices_DepcrecatedDeprecated
ethAppointmentInstanceNo DB-side consumers found
ethBookingAppointmentSkillNo DB-side consumers found
ethBookingEstimator_DeprecatedDeprecated
ethGeoLocationStatusNo DB-side consumers found
ethFlowLogs_DeprecatedDeprecated
ethKpiMeasures_DeprecatedDeprecated
ethKpiResultsActive_DeprecatedDeprecated
ethKpiResultsClosed_DeprecatedDeprecated
ethPrimeInvoiceUserNo DB-side consumers found
ethStagehandTasksProbably written/read by the Stagehand integration directly
ethTaskSchedule_DeprecatedDeprecated
ethWIPClientHistory_DeprecatedDeprecated
kpiTableLookup_DeprecatedDeprecated
kpiTableResponsibilitiesLookup_DeprecatedDeprecated
primeJobsTempTemp/staging copy of primeJobs
wipStatusLookup table

2. Hub tables (top 20 by total references) ​

#TableViewsProceduresTotal
1primeJobs56110166
2primeUsers334679
3primeContacts95059
4ethBooking63541
5makesafeUser23638
6makesafePhoneCall23436
7optimoRouteOrder33235
8primeAppointments32528
9primeStatuses23528
10ethBookingEstimatorSkill22123
11primeStatusHistories_Job101222
12ethWIPJobHistory61420
13makesafeSMSMessage02020
14makesafeSiteOptions01818
15primeJobsLocation71118
16primeAppointmentType31417
17elevenLabsConversations21416
18ethTask01616
19primeWorkOrders41115
20primeAllocations41015

primeJobs is by far the centre of the schema (referenced by more than half of all views). primeUsers, primeContacts and primeStatuses form the core Prime Ecosystem cluster; ethBooking/ethBookingEstimatorSkill, the makesafe* group, and optimoRouteOrder are the main Ethos-built clusters.

3. Deprecated-style objects ​

Tables with deprecated/stage/temporal/EventLog names ​

TableStill referenced?
EthAppointmentConfig_DepcreatedNo
EventLog_DeprecatedNo
MSSQL_TemporalHistoryFor_731865674No (system temporal history)
PrimeAccountsPayableInvoices_DepcrecatedNo
ethBookingEstimator_DeprecatedNo
ethFlowLogs_DeprecatedNo
ethKpiMeasures_DeprecatedNo
ethKpiResultsActive_DeprecatedNo
ethKpiResultsClosed_DeprecatedNo
ethTaskSchedule_DeprecatedNo
ethWIPClientHistory_DeprecatedNo
kpiTableLookup_DeprecatedNo
kpiTableResponsibilitiesLookup_DeprecatedNo
primeExportsEndataScopeImport_stageYes — 5 references (active staging table)
makesafeEventLogYes — 2 references
makesafeEventLogActionYes — 1 reference

All 13 _Deprecated/_Depcreated/_Depcrecated tables have zero references — they appear safe to drop from the live database. The _stage and makesafeEventLog* tables are in active use despite the suggestive names.

Deprecated-named views and procedures (all _Deprecated variants) ​

7 views (vEthKpiResults*_Deprecated, vKpiResultsClosed_Deprecated) and 21 procedures (booking, KPI, spEthTask*, OptimoRoute variants) carry a deprecated suffix. None of them is referenced by any other view or procedure in the snapshot. Note that several of these deprecated procs are the only remaining "users" of already-dropped tables (see §4), confirming they no longer run.

spMakesafeInsertEventLog is referenced 18 times but is an active event-logging proc, not deprecated — it only matched on the "EventLog" pattern.

4. Broken references (SQL referencing objects that no longer exist) ​

Objects whose SQL references a dbo.-qualified table absent from schemas/tables/ (and not a view/proc/function either):

Referencing objectKindMissing object(s)
vReportFilterSupervisorTypeviewkpiTableResponsibilitiesLookup
spPrimeGetQueuedEmailMessagesprocedureEmailMessageQueue
spPrimeGetQueuedEmailMessagesCountprocedureEmailMessageQueue
spPrimeUpdateQueuedEmailMessageprocedureEmailMessageQueue
vEthKpiResultsActive_DeprecatedviewkpiTableResponsibilitiesLookup
spEthBookingDaySlotUpsert_deprecatedprocedureethBookingEstimator
spEthBookingGetAvailabilityPerSlot_DeprecatedprocedureethBookingEstimator
spEthTaskGetFlowsToCancel_DeprecatedprocedureethTaskSchedule
spEthTaskGetNext_Depcrecated + 6 other spEthTask*_Dep* procsproceduresethTaskSchedule
spPopulateKpiDate_DeprecatedprocedurekpiDate
CommandExecute, DatabaseIntegrityCheck, IndexOptimizeproceduresCommandLog, Queue, QueueDatabase (Ola Hallengren maintenance objects — referenced conditionally, benign)
sp_upgraddiagramsproceduredtproperties (legacy SQL Server diagram support, benign)

Key points:

  • The four bold rows are not deprecated-named objects: vReportFilterSupervisorType will fail at runtime (its source table survives only as kpiTableResponsibilitiesLookup_Deprecated), and the three spPrime*QueuedEmailMessage* procs reference an EmailMessageQueue table that does not exist in the snapshot at all.
  • Everything else is a deprecated proc/view pointing at a table that has since been renamed _Deprecated or dropped — consistent evidence that those objects are dead and safe to remove.
  • No view dependencies array points at a missing object (0 broken dependency entries).