use master go ), ((case qs.statement_end_offset then datalength(qt.text) else qs.statement_end_offset )) ,database_name=db.name ,qs.execution_count ,qs.total_logical_reads ,logical_reads_per_run,)) ,qs.last_logical_reads ,qs.total_logical_writes ,qs.…