writing-a-metric__enter-the-t-sql-query