Microsoft SQL Server 2008 R2 Unleashed
Ray Rankins
Paul Bertucci
Chris Gallelli
Alex T. Silverstein
800 East 96th Street, Indianapolis, Indiana 46240 USA
Microsoft SQL Server 2008 R2 Unleashed
Copyright 2011 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-33056-8
ISBN-10: 0-672-33056-3
Publisher
Paul Boger
Editor In Chief
Karen Gettman
Acquisitions Editor
Neil Rowe
Development Editor
Mark Renfrow
Managing Editor
Sandra Schroeder
Project Editor
Seth Kerney
Copy Editor
Chuck Hutchinson
Indexer
Erika MIllen
Proofreader
Leslie Joseph
Debbie Williams
Technical Editor
Rebecca M. Riordan
J. Boyd Nolan
Publishing Coordinator
Romney French
Multimedia Developer
Dan Scherf
Designer
Gary Adair
Compositor
Mark Shirar
Library of Congress Cataloging-in-Publication Data is on file.
Printed in the United States of America
First Printing September 2010
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The author(s) and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the CD or programs accompanying it.
Bulk Sales
Pearson offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact:
U.S. Corporate and Government Sales
1-800-382-3419
For sales outside of the U.S., please contact:
International Sales
+1-317-581-3793
Dedication
I would like to dedicate this book in loving memory of my grandmother, Gertrude Holdridge, who recently passed away at the young age of 87. You will be dearly missed, Gramma Gert.
Ray Rankins
Dedicated to my children, for the countless times they heard me say No, not now, Im writing chapters! Thanks, Paul Jr., Marissa, Nina, Juliana, and Donny; I love you all very much!
Paul Bertucci
This book is dedicated to my Mom and Dad. My mother, Arlene Gallelli, is the perfect mom. Her love, kindness, and relentless support have helped me in all aspects of my life, including the creation of this book. My Dad, Joe Gallelli, is a great father and a great friend. He is an encyclopedia of knowledge, and I can always count on his wisdom and guidance. Thank you both.
Chris Gallelli
My work on this book is dedicated to my father, Harry Silverstein, a fellow man of letters. For, while his stay with us on this planet was not nearly long enough, he left us with a feeling of kindness and a call to humanity and fellowship with all that has remained for a lifetime. Thank you, Harry, for having been you.
Alex T. Silverstein
Table of Contents
Chapters on the CD
About the Authors
Ray Rankins is owner and president of Gotham Consulting Services, Inc. (.
Paul Bertucci is the founder of Database Architechs (.
.
Alex T. Silverstein is owner and chief information officer of Unified Digital Group, LLC, a consulting and custom software development firm headquartered near Saratoga Springs, New York. He specializes in designing SQL Server and Microsoft .NETpowered solutions using the principles of agile development and the Rational Unified Process. Alex has more than a decade of experience providing application development, database administration, and training services worldwide to a variety of industries. He was also a coauthor for Microsoft SQL Server 2005 Unleashed and a contributing author for Microsoft SQL Server 2000 Unleashed, both published by Sams Publishing. You can reach Alex anytime via email at .
About the Contributing Author
Hilary Cotter is a SQL Server MVP with more than 20 years of IT experience working for Fortune 500 clients. He is the author of a book on SQL Server Replication and coauthor of Microsoft SQL Server 2008 Management and Administration from Sams Publishing. Hilary has also written numerous white papers and articles on SQL Server and databases.
Acknowledgments
I would first like to thank my coauthors for their tireless efforts in helping to turn out a quality publication and their willingness to take on more work when needed to help keep things on track. I would also like to thank Neil Rowe at Sams Publishing for providing us the opportunity to write this book and for his seemingly infinite patience as we repeatedly missed our deadlines.
I would also like to acknowledge my colleague and friend David Solomon for developing the Word macro used to extract the code listings and examples presented in the chapters so we could make them available on the included CD. His efforts made that task significantly easier. I would also like to thank David for his help reviewing some of my chapters.
I would also like to acknowledge and thank Ross Mistry for providing content for the chapters.
Most of all, I wish to thank my loving wife, Elizabeth, for her patience and understanding during the long days, late nights, and lost weekends spent working on yet another book. Ill be getting to that honey-do list now, my dear.
Ray Rankins
With any writing effort, there is always a huge sacrifice of time that must be made to properly research, demonstrate, and describe leading-edge subject matter. The brunt of the burden usually falls on those many people who are near and very dear to me. With this in mind, I desperately need to thank my family for allowing me to encroach on many months of what should have been my familys quality time.
However, with sacrifice also comes reward in the form of technical excellence and high-quality business relationships. Many individuals were involved in this effort, both directly and indirectly, starting with the other authors (thanks RR, CG, and AS!), Steve Luk, Raymond Hardman, Jason Riedberger, John Martin, Gene Vilain, Yves Moison, Thierry Gerardin, Mark Ginnebaugh (of DesignMind), and Nathan Gustafson. Their expertise in and knowledge of database engines, SQL, performance and tuning, data replication, database mirroring, database snapshots, business intelligence, data integration, and high availability are unmatched.