Skip to Content
Professional SQL Server™ 2005 Programming
book

Professional SQL Server™ 2005 Programming

by Robert Vieira
December 2006
Beginner
912 pages
24h 44m
English
Wrox
Content preview from Professional SQL Server™ 2005 Programming

23.10. Troubleshooting

SQL Server offers a number of options to help with the prevention, detection, and measurement of long-running queries. The options range from a passive approach of measuring actual performance, so you know what's doing what, to a more active approach of employing a query "governor" to automatically kill queries that run over a length of time you choose. These tools are very often ignored or used only sparingly — which is something of a tragedy — they can save hours of troubleshooting by often leading you right to the problem query and even the specific portion of your query that is creating the performance issues.

Tools to take a look at include:

  • SHOWPLAN TEXT|ALL and Graphical showplan — Looked at in this chapter

  • STATISTICS IO — Also in this chapter

  • Database Consistency Checker (DBCC) — Also in this chapter

  • The Query Governor — Also in this chapter

  • The sys.processes table function

  • The SQL Server Profiler — Covered in this chapter

Many people are caught up in just using one of these, but the reality is that there is little to no (depending on which two you're comparing) overlap between them. This means that developers and DBAs who try to rely on just one of them are actually missing out on a lot of potentially important information.

Also, keep in mind that many of these are still useful in some form even if you are writing in a client-side language and sending the queries to the server (no sprocs). You can either watch the query come through to your server using ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Professional Microsoft® SQL Server® 2008 Programming

Professional Microsoft® SQL Server® 2008 Programming

Rob Vieira, Mahsa Nakhjiri

Publisher Resources

ISBN: 9780764584343Purchase book