Chapter 11. Useful scripts

 

This chapter covers
  • Viewing everyone’s last-run SQL query
  • A generic performance test harness
  • Estimating the finishing time of jobs
  • Finding where your query really spends its time
  • A simple lightweight tracing utility

 

Gallimaufry refers to “odds and ends,” and that nicely sums up the content of this chapter. It contains a hodgepodge of scripts that can reveal some interesting and useful information. The scripts given in this chapter wouldn’t sit comfortably within the other chapters of the book.

The content of this chapter is wide ranging, covering such diverse areas as finding which SQL queries everyone last ran, getting Windows system information within SQL Server, determining where your queries really ...

Get SQL Server DMVs in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.