PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2007 by GrandMasters
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form
or by any means without the written permission of the publisher.
Library of Congress Control Number: 2007922585
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 QWT 2 1 0 9 8 7
Distributed in Canada by H.B. Fenn and Company Ltd.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further infor-
mation about international editions, contact your local Microsoft Corporation office or contact Microsoft
Press International directly at fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress.
Send comments to tkinput@microsoft.com.
Microsoft, Microsoft Press, Active Directory, ActiveSync, ActiveX, Excel, Internet Explorer, MSDN,
MSN, Outlook, PowerPoint, SQL Server, Visual Basic, Visual C#, Visual FoxPro, Visual J#, Visual
Studio, Win32, Windows, Windows Live, Windows Mobile, Windows NT, Windows Server, and
Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries. Other product and company names mentioned herein may be the
trademarks of their respective owners.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places,
and events depicted herein are fictitious. No association with any real company, organization, product,
domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
7KLVERRNH[SUHVVHVWKHDXWKRU¶VYLHZVDQGRpinions. The information contained in this book is provided
without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its
resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly
or indirectly by this book.
Acquisitions Editor: Ken Jones
Developmental Editor: Karen Szall
Project Editor: Maria Gargiulo
Editorial Production: nSight, Inc.
Body Part No. X13-62481
Dedication
To my Mom and Dad, who have always been a tremendous inspiration for me.
I am nothing without you both. I love you.
—Sara Morgan
To my fiancée, Frida, my mother, Viveca, and the memory of my father, Bertil.
—Tobias Thernström
To my wife, Mary, who patiently endured the late nights and long weekends that were spent
on this effort, and to Nikki the Rottweiler, who tried her best to help but just
couldn’t get the syntax down.
—Ted Malone
vii
About the Authors
Sara Morgan
Sara Morgan, an independent author and consultant based in
Baton Rouge, Louisiana, is an MCSD and MCDBA and is certified
in SQL Server 2000 and Visual Basic .NET. She specializes in devel-
oping leading-edge Web-based applications using Microsoft tech-
nologies. Since graduating from Louisiana State University with a
degree in quantitative business analysis, she has been developing
software for a variety of industries, including a not-for-profit hospi-
tal, a financial company offering mortgages, a major retailer, a soft-
ware company that writes legislative software, and an application
service provider.
Sara has written articles for MSDN Magazine, Enterprise Development, .NET Development, Visual
Studio Magazine, and DevX.com. She has also co-written MCTS Self-Paced Training Kit (Exam
70-529): Microsoft .NET Framework 2.0 Distributed Application Development (Microsoft Press,
2006) and MCPD Self-Paced Training Kit (Exam 70-547): Designing and Developing Web-Based
Applications Using the Microsoft .NET Framework. Sara’s articles about enhanced computing
and her latest research efforts can be found at http://www.custsolutions.net.
To b i a s T h e r n s t r ö m
Tobias Thernström has enjoyed the company of SQL Server for
over 10 years. He is a senior database architect and trainer at Rbam
AB (www.rbam.se), a professional software services company
located in Sweden. Tobias has been involved in the development of
several SQL Server certifications provided by Microsoft. He is an
MCT and co-founder of the Swedish SQL Server User Group
(www.sqlug.se).
viii
Te d M a l o n e
Ted Malone has been working with SQL Server since the days of
OS/2 and has developed database systems ranging from small to
extremely large. Ted is currently product strategy architect for Con-
figuresoft, Inc. (http://www.configuresoft.com), a Colorado Springs,
Colorado–based software development firm and Microsoft Gold
ISV Partner that specializes in delivering enterprise management
tools for Fortune 1000 corporations. Ted is the vice president of
the Rocky Mountain SQL Server Users Group and a frequent con-
tributor to the Professional Association for SQL Server. Ted was
also a contributing author to SQL Server Security (McGraw-Hill
Osborne Media, 2003) as well as a contributor to several SQL
Server 2005 study guides.
In his free time, Ted enjoys the Colorado wilderness with his family and dogs. Ted is also an
avid pilot with more than 4,000 hours of flight time and enjoys riding his motorcycle when-
ever possible.