Thông tin tài liệu
by Robert D. Schneider and Darril Gibson
Microsoft
®
SQL
Server
®
2008
ALL-IN-ONE DESK REFERENCE
FOR
DUMmIES
‰
01_179543-ffirs.qxp 8/23/08 12:23 AM Page i
01_179543-ffirs.qxp 8/23/08 12:23 AM Page iv
by Robert D. Schneider and Darril Gibson
Microsoft
®
SQL
Server
®
2008
ALL-IN-ONE DESK REFERENCE
FOR
DUMmIES
‰
01_179543-ffirs.qxp 8/23/08 12:23 AM Page i
Microsoft
®
SQL Server
®
2008 All-in-One Desk Reference For Dummies
®
Published by
Wiley Publishing, Inc.
111 River Street
Hoboken, NJ 07030-5774
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permit-
ted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written
permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the
Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing,
Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at
http://www.wiley.com/go/permissions.
Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the
Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade
dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United
States and other countries, and may not be used without written permission. Microsoft and SQL Server
are registered trademarks of Microsoft Corporation in the United States and/or other countries. All other
trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any
product or vendor mentioned in this book.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS
OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND
SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS.
THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS
SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING,
OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPE-
TENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE
FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS
WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE
AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR
RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN
THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT
IS READ.
For general information on our other products and services, please contact our Customer Care
Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002.
For technical support, please visit www.wiley.com/techsupport.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic books.
Library of Congress Control Number: 2008933788
ISBN: 978-0-470-17954-3
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
01_179543-ffirs.qxp 8/23/08 12:23 AM Page ii
About the Authors
Robert D. Schneider has more than 15 years of experience developing and
delivering sophisticated software solutions worldwide. He has provided tech-
nical and business expertise on topics such as Service Oriented Architecture
(SOA), database optimization, and distributed computing to a wide variety of
enterprises in the financial, technology, and government sectors. Clients have
included Chase Manhattan Bank, VISA, HP, SWIFT, Booz Allen Hamilton, and
the governments of the United States, Mexico, Brazil, and Malaysia.
Robert is the author of Optimizing Informix Applications, Microsoft SQL Server:
Planning and Building a High Performance Database, MySQL Database Design
and Tuning, and SQL Server 2005 Express For Dummies. He has also written
numerous articles on technical and professional services topics and has been
quoted as a subject matter expert in publications worldwide. He can be
reached at Robert.Schneider@Think88.com.
Darril Gibson has been a Microsoft Certified Trainer (MCT) for more than
nine years, providing training on SQL Server (since SQL Server version 7.0)
and a wide variety of other Microsoft technologies. He is currently contracted
with the U.S. Air Force, providing extensive technical training to Air Force
personnel in support of a major network operations support center. He holds
nearly 20 current certifications and has been certified in each SQL Server ver-
sion since SQL Server 7.0.
Darril is the author of MCITP: SQL Server 2005 Database Administration All-In-
One and MCITP: SQL Server 2005 Database Developer All-In-One. He developed
several video training courses for Keystone Learning on several certification
topics including A+, MCSE, and Microsoft Exchange. He has also developed
several courses teaching technical topics at the college and university level,
and for U.S. government clients.
Dedication
To my family for their support, patience, and encouragement.
—Robert D. Schneider
To my loving wife of 16 years who I’m grateful to also call my best friend.
—Darril Gibson
Authors’ Acknowledgments
The authors want to acknowledge the following people for their invaluable
assistance in creating and publishing this work: Carole McLendon, Nicole
Sholly, Kyle Looper, Brian Walls, Toni Settle, Joan K. Griffitts.
01_179543-ffirs.qxp 8/23/08 12:23 AM Page iii
Publisher’s Acknowledgments
We’re proud of this book; please send us your comments through our online registration form
located at www.dummies.com/register/.
Some of the people who helped bring this book to market include the following:
Acquisitions and Editorial
Project Editor: Nicole Sholly
Acquisitions Editor: Kyle Looper
Copy Editor: Brian Walls
Technical Editor: Damir Bersinic
Editorial Manager: Kevin Kirschner
Editorial Assistant: Amanda Foxworth
Sr. Editorial Assistant: Cherie Case
Cartoons: Rich Tennant
(www.the5thwave.com)
Composition Services
Project Coordinator: Katie Key
Layout and Graphics: Carl Byers,
Reuben W. Davis, Ronald Terry
Proofreaders: David Faust, Jessica Kramer,
Toni Settle
Indexer: Joan K. Griffitts
Publishing and Editorial for Technology Dummies
Richard Swadley, Vice President and Executive Group Publisher
Andy Cummings, Vice President and Publisher
Mary Bednarek, Executive Acquisitions Director
Mary C. Corder, Editorial Director
Publishing for Consumer Dummies
Diane Graves Steele, Vice President and Publisher
Joyce Pepple, Acquisitions Director
Composition Services
Gerry Fahey, Vice President of Production Services
Debbie Stailey, Director of Composition Services
01_179543-ffirs.qxp 8/23/08 12:23 AM Page iv
Contents at a Glance
Introduction 1
Book I: Essential Concepts 7
Chapter 1: Introducing SQL Server 2008 9
Chapter 2: SQL Server Architecture and Key Concepts 15
Chapter 3: Getting Started, Getting Around 23
Chapter 4: Setting Up SQL Server 2008 35
Chapter 5: Using SQL Server Management Studio 59
Book II: Designing and Using Databases 73
Chapter 1: Setting Up a Database 75
Chapter 2: Care and Feeding of Your Database 89
Chapter 3: Data Types and How to Use Them 99
Chapter 4: Constructing New Tables 121
Chapter 5: Looking After Your Tables 141
Chapter 6: Understanding Relationships 155
Book III: Interacting with Your Data 175
Chapter 1: Using Proper Normalization Techniques 177
Chapter 2: The SQL Server Optimizer 187
Chapter 3: Using the Query Designer 201
Chapter 4: Setting Query Options 213
Chapter 5: Searching for Information 231
Chapter 6: Organizing Query Results 257
Chapter 7: Modifying Your Data 265
Chapter 8: Taking Advantage of Views 273
Chapter 9: Advanced Query Topics 291
Book IV: Database Programming 313
Chapter 1: Understanding Transact-SQL 315
Chapter 2: Stored Procedures and Functions 331
Chapter 3: Triggers 349
Chapter 4: Working with Visual Studio 361
Chapter 5: Web Services 375
Chapter 6: Developing Remote Applications 385
Chapter 7: Advanced Development Topics 401
02_179543-ftoc.qxp 8/23/08 12:23 AM Page v
Book V: Reporting Services 419
Chapter 1: Introduction to SQL Server Reporting Services 421
Chapter 2: Creating Reports with Report Builder 435
Chapter 3: Creating Reports with Report Designer 449
Chapter 4: Integrating Reports 469
Book VI: Analysis Services 477
Chapter 1: Introduction to SQL Server Analysis Services 479
Chapter 2: Creating Business Intelligence Solutions with BIDS 493
Chapter 3: Data Mining and Maintaining Analysis Services Objects 517
Book VII: Performance Tips and Tricks 529
Chapter 1: Working with the SQL Server Optimizer 531
Chapter 2: Using Performance Monitoring Tools 541
Chapter 3: Data Access Strategies 569
Chapter 4: Tuning SQL Server 587
Book VIII: Database Administration 601
Chapter 1: Configuring SQL Server 603
Chapter 2: Performing Major Administrative Tasks 619
Chapter 3: Security: Keeping SQL Server Safe 647
Chapter 4: Integration and Your Database 661
Chapter 5: Replication 677
Chapter 6: Spreading the Load with Partitioning 693
Book IX: Appendixes 701
Appendix A: Ten Sources of Information on SQL Server 2008 703
Appendix B: Troubleshooting SQL Server 2008 707
Appendix C: Glossary 715
Index 725
02_179543-ftoc.qxp 8/23/08 12:23 AM Page vi
Table of Contents
Introduction 1
About This Book 1
Foolish Assumptions 1
Conventions Used in This Book 2
What You Don’t Have to Read 2
How This Book Is Organized 3
Book I: Essential Concepts 3
Book II: Designing and Using Databases 3
Book III: Interacting with Your Data 4
Book IV: Database Programming 4
Book V: Reporting Services 4
Book VI: Analysis Services 4
Book VII: Performance Tips and Tricks 4
Book VIII: Database Administration 5
Book IX: Appendixes 5
Icons Used in This Book 5
Where to Go from Here 6
Book I: Essential Concepts 7
Chapter 1: Introducing SQL Server 2008 . . . . . . . . . . . . . . . . . . . . . . . . . .9
SQL Server 2008: An Evolution, Not a Revolution 9
More development productivity 10
Improved integration 11
Enhanced security 12
Streamlined administration 12
Understanding SQL Server’s Editions 13
Chapter 2: SQL Server Architecture and Key Concepts . . . . . . . . . . . .15
Relational Databases: The Heart of Modern Computing Solutions 15
Understanding Key SQL Server 2008 Concepts 16
Reliability 16
Security 17
Flexibility 17
Administration 17
Application Development 18
Business Intelligence 19
Reporting 20
Integration 20
02_179543-ftoc.qxp 8/23/08 12:23 AM Page vii
Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies
viii
Chapter 3: Getting Started, Getting Around . . . . . . . . . . . . . . . . . . . . . .23
Hardware and Software Requirements 23
Converting to SQL Server 2008 25
Upgrading from earlier versions of SQL Server 25
Converting from a different database 27
Tools at Your Disposal 29
Administration 29
Performance 30
Software development 33
Chapter 4: Setting Up SQL Server 2008 . . . . . . . . . . . . . . . . . . . . . . . . . .35
Installing SQL Server 35
Creating and Maintaining Configurations 43
SQL Server communication protocols 43
Reporting services configuration 45
SQL Server features 47
Streamlining Administration 47
SQL Server Maintenance Plan Wizard 47
Policy-based management 51
Chapter 5: Using SQL Server Management Studio . . . . . . . . . . . . . . . .59
Menu Structure and Icons 60
Object Explorer 60
Template Explorer 62
Solution Explorer 63
Running Queries 64
Query-specific user interface features 64
Creating a query 66
Using the Query Designer 68
Book II: Designing and Using Databases 73
Chapter 1: Setting Up a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
System Databases 75
Connecting to a Database Server 76
Exploring an Existing Database 78
Understanding the Major Database Objects 79
Creating a New Database 80
Using SQLCMD to Create a Database 86
Scripting Your Database 87
Chapter 2: Care and Feeding of Your Database . . . . . . . . . . . . . . . . . . .89
Renaming a Database 89
Changing Database Parameters 90
General 91
Files 92
02_179543-ftoc.qxp 8/23/08 12:23 AM Page viii
[...]... Understanding SQL Server Partitioning 693 Partitioning Key Terms and Concepts .695 Setting Up Partitioning in Your Environment 696 02_179543-ftoc.qxp xx 8/23/08 12:23 AM Page xx Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies Book IX: Appendixes 701 Appendix A: Ten Sources of Information on SQL Server 2008 703 Microsoft SQL Server Web Site 703 Microsoft SQL Server. .. 02_179543-ftoc.qxp 8/23/08 xviii 12:23 AM Page xviii Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies Book VIII: Database Administration 601 Chapter 1: Configuring SQL Server 603 SQL Server Configuration Tools 603 SQL Server Configuration Manager 604 SQL Server Surface Area Configuration Tool 604 sp_configure 604 SQL Server Management... 8/23/08 12:23 AM Page x Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies Chapter 6: Understanding Relationships 155 Relationships: Making Data Meaningful 155 Relationship Types 156 One-to-one 157 One-to-many 157 Many-to-many .157 Constraints 158 Creating Relationships 160 The SQL Server Management Studio... Data from Your Database 270 02_179543-ftoc.qxp xii 8/23/08 12:23 AM Page xii Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies Chapter 8: Taking Advantage of Views 273 Tying Information Together with Views 273 Creating a View 275 Creating a view with the View Designer 275 Creating a view with T -SQL .278 Using a View ... likely to find yourself skipping the information called out by the Technical Stuff icons Just as your car runs without you memorizing the workings of its transmission, you can derive a lot of value from SQL Server 2008 without knowing its internal architecture How This Book Is Organized SQL Server 2008 All-in-One Desk Reference For Dummies is split into nine mini-books You don’t have to read it sequentially,... to Distribute Data 375 Requesting data and getting a response 377 Seeing a Web service in action 378 02_179543-ftoc.qxp xiv 8/23/08 12:23 AM Page xiv Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies Using Web Services in Conjunction with SQL Server 379 Creating HTTP endpoints to support Web services 380 Exploring the SOAP request and the SOAP response 383 Chapter... 04_179543-pp01.qxp 8/23/08 12:24 AM Page 8 Contents at a Glance Chapter 1: Introducing SQL Server 2008 9 SQL Server 2008: An Evolution, Not a Revolution 9 Understanding SQL Server s Editions 13 Chapter 2: SQL Server Architecture and Key Concepts 15 Relational Databases: The Heart of Modern Computing Solutions 15 Understanding Key SQL Server 2008 Concepts... Queries 64 05_179543-bk01ch01.qxp 8/23/08 12:24 AM Page 9 Chapter 1: Introducing SQL Server 2008 In This Chapter ߜ SQL Server 2008: An evolution, not a revolution ߜ More development productivity ߜ Improved integration ߜ Additional security and administrative options ߜ Understanding SQL Server s editions B efore you take the plunge into SQL Server 2008, it’s only natural for you to wonder what you’re... every edition of SQL Server 2008 More development productivity Microsoft s software architecture and database tools have always offered excellent integration and productivity SQL Server 2008 amplifies the firm’s “Developers, developers, developers, developers!” mantra Here’s how SQL Server 2008 has helped this important audience: 05_179543-bk01ch01.qxp 8/23/08 12:24 AM Page 11 SQL Server 2008: An Evolution,... with past versions of SQL, this mini-book gives you valuable insight into what you can achieve with SQL Server 2008 Book V: Reporting Services You know there’s data in there How can you get it out? This is a common challenge for database users With SQL Server Reporting Services in SQL Server 2008, Microsoft has significantly improved the ability to get the data to the users’ desktops by using familiar . Gibson
Microsoft
®
SQL
Server
®
2008
ALL-IN-ONE DESK REFERENCE
FOR
DUMmIES
‰
01_179543-ffirs.qxp 8/23/08 12:23 AM Page i
Microsoft
®
SQL Server
®
2008 All-in-One. 378
02_179543-ftoc.qxp 8/23/08 12:23 AM Page xiii
Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies
xiv
Using Web Services in Conjunction with SQL Server
Ngày đăng: 27/01/2014, 09:20
Xem thêm: Tài liệu Wiley - Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies (2008)01 doc, Tài liệu Wiley - Microsoft SQL Server 2008 All-in-One Desk Reference For Dummies (2008)01 doc