About the Authors |
|
xvii | |
About the Technical Reviewers |
|
xix | |
Acknowledgments |
|
xxi | |
Introduction |
|
xxiii | |
|
SQL Server Overview and Installation |
|
|
1 | (24) |
|
|
1 | (2) |
|
|
3 | (5) |
|
|
3 | (1) |
|
|
4 | (4) |
|
|
8 | (15) |
|
Minimum System Requirements |
|
|
8 | (2) |
|
|
10 | (9) |
|
|
19 | (3) |
|
|
22 | (1) |
|
Side-by-Side Installation |
|
|
23 | (1) |
|
Upgrading from SQL Server 2000 and 7.0 |
|
|
23 | (1) |
|
|
23 | (2) |
|
SQL Server Management Technologies |
|
|
25 | (28) |
|
Connecting to and Managing Your SQL Servers |
|
|
25 | (3) |
|
Context-Sensitive Menus for Each Object Type |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
User Interface Enhancements |
|
|
28 | (7) |
|
Asynchronous Treeview and Object Filtering |
|
|
29 | (1) |
|
Nonmodal and Resizable Dialog Boxes |
|
|
29 | (1) |
|
Script and Schedule Enhancements |
|
|
30 | (1) |
|
|
31 | (2) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
35 | (13) |
|
Dedicated Administrator Connection |
|
|
35 | (1) |
|
|
36 | (1) |
|
Performance Monitor Correlation |
|
|
37 | (1) |
|
Server Registration Import/Export |
|
|
38 | (1) |
|
Maintenance Plan Designer |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
39 | (2) |
|
Catalog Views and Dynamic Management Views |
|
|
41 | (2) |
|
|
43 | (1) |
|
|
44 | (1) |
|
SQL Configuration Manager |
|
|
44 | (1) |
|
Surface Area Configurator |
|
|
45 | (2) |
|
Enhanced Help and Community Integration |
|
|
47 | (1) |
|
|
48 | (1) |
|
Server Management Objects |
|
|
49 | (3) |
|
|
52 | (1) |
|
T-SQL Enhancements for Developers |
|
|
53 | (50) |
|
Enhancements Affecting DML |
|
|
53 | (33) |
|
Old-Style Outer Joins Deprecated |
|
|
54 | (1) |
|
|
55 | (8) |
|
|
63 | (3) |
|
Extensions to the FROM Clause |
|
|
66 | (10) |
|
|
76 | (1) |
|
|
77 | (6) |
|
|
83 | (2) |
|
|
85 | (1) |
|
|
86 | (15) |
|
|
87 | (7) |
|
.Write Extension to the UPDATE Statement |
|
|
94 | (2) |
|
|
96 | (1) |
|
|
96 | (3) |
|
|
99 | (2) |
|
|
101 | (2) |
|
T-SQL Enhancements for DBAs |
|
|
103 | (32) |
|
|
103 | (4) |
|
|
104 | (1) |
|
|
104 | (2) |
|
Dynamic Management Views and Functions |
|
|
106 | (1) |
|
|
107 | (5) |
|
Creating and Altering DDL Triggers |
|
|
108 | (1) |
|
|
109 | (1) |
|
Enabling and Disabling DDL Triggers |
|
|
109 | (1) |
|
Enumerating DDL Triggers Using Catalog Views |
|
|
109 | (1) |
|
Programming DDL Triggers with the eventdata() Function |
|
|
110 | (2) |
|
Indexing and Performance Enhancements |
|
|
112 | (7) |
|
|
112 | (1) |
|
Controlling Locking During Index Creation |
|
|
113 | (1) |
|
Creating Indexes with Additional Columns Included |
|
|
113 | (1) |
|
|
114 | (3) |
|
Using Statistics for Correlated DateTime Columns |
|
|
117 | (1) |
|
Improving Performance of Ordering for Tertiary Collations |
|
|
118 | (1) |
|
Table and Index Partitioning |
|
|
119 | (6) |
|
|
120 | (1) |
|
|
120 | (1) |
|
Creating Partitioned Tables and Indexes |
|
|
121 | (1) |
|
Adding and Removing Partitions |
|
|
122 | (1) |
|
Modifying Partition Functions and Schemes |
|
|
123 | (1) |
|
Switching Tables into and out of Partitions |
|
|
124 | (1) |
|
Managing Table and Index Partitions |
|
|
125 | (1) |
|
Enhancements to Tables and Views |
|
|
125 | (2) |
|
Enhancements to Indexed Views |
|
|
125 | (1) |
|
Persisted Computed Columns |
|
|
126 | (1) |
|
|
127 | (5) |
|
|
127 | (3) |
|
|
130 | (2) |
|
Data Integrity Enhancements |
|
|
132 | (1) |
|
Verifying a Database's Pages |
|
|
132 | (1) |
|
Putting a Database into an Emergency State |
|
|
132 | (1) |
|
|
133 | (2) |
|
|
135 | (26) |
|
Introduction to SQL Server .NET Integration |
|
|
135 | (2) |
|
Why Does SQL Server 2005 Host the CLR? |
|
|
136 | (1) |
|
|
136 | (1) |
|
When Not to Use CLR Routines |
|
|
136 | (1) |
|
How SQL Server Hosts .NET: An Architectural Overview |
|
|
137 | (1) |
|
SQL Server .NET Programming Model |
|
|
137 | (2) |
|
Enhancements to ADO.NET for SQL Server Hosting |
|
|
138 | (1) |
|
Overview of the New .NET Namespaces for SQL Server |
|
|
138 | (1) |
|
Programming a CLR Stored Procedure |
|
|
139 | (18) |
|
Starting a Visual Studio 2005 SQL Server Project |
|
|
140 | (3) |
|
Anatomy of a Stored Procedure |
|
|
143 | (1) |
|
|
144 | (1) |
|
|
144 | (2) |
|
|
146 | (2) |
|
Putting It All Together: Coding the Body of the Stored Procedure |
|
|
148 | (3) |
|
Testing the Stored Procedure |
|
|
151 | (1) |
|
|
152 | (1) |
|
Throwing Exceptions in CLR Routines |
|
|
153 | (4) |
|
|
157 | (2) |
|
|
159 | (2) |
|
|
161 | (46) |
|
|
161 | (22) |
|
Applications for User-Defined Types |
|
|
162 | (1) |
|
Adding a User-Defined Type to a SQL Server Project |
|
|
162 | (2) |
|
Parts of a User-Defined Type |
|
|
164 | (3) |
|
A Simple Example: The PhoneNumber Type |
|
|
167 | (8) |
|
Another Example: The StringArray Type |
|
|
175 | (7) |
|
Managing User-Defined Types |
|
|
182 | (1) |
|
CLR User-Defined Functions |
|
|
183 | (10) |
|
Adding a User-Defined Function to a Visual Studio Project |
|
|
184 | (1) |
|
The Visual Studio 2005 User-Defined Function Template |
|
|
184 | (1) |
|
The SqlFunction Attribute |
|
|
184 | (1) |
|
Scalar User-Defined Functions |
|
|
185 | (3) |
|
Table-Valued User-Defined Functions |
|
|
188 | (4) |
|
Managing CLR User-Defined Functions |
|
|
192 | (1) |
|
CLR User-Defined Aggregates |
|
|
193 | (7) |
|
Adding a User-Defined Aggregate to a SQL Server Project |
|
|
193 | (2) |
|
Parts of a User-Defined Aggregate |
|
|
195 | (5) |
|
CLR User-Defined Triggers |
|
|
200 | (5) |
|
Adding a CLR User-Defined Trigger to a SQL Server Project |
|
|
200 | (1) |
|
|
201 | (4) |
|
Managing User-Defined Triggers |
|
|
205 | (1) |
|
|
205 | (1) |
|
A Note Regarding Visual Studio 2005 |
|
|
206 | (1) |
|
|
206 | (1) |
|
|
207 | (40) |
|
|
207 | (1) |
|
What Are XPath and the XMLDOM? |
|
|
208 | (5) |
|
|
210 | (1) |
|
|
211 | (1) |
|
The XMLDOM-XML Document Object Model |
|
|
211 | (1) |
|
The XPathDocument, XPathNavigator, and XPathExpression Classes |
|
|
212 | (1) |
|
Getting XML into the Database |
|
|
213 | (17) |
|
|
214 | (1) |
|
|
214 | (1) |
|
|
215 | (5) |
|
SQLXML: XML Views Using Annotated XML Schemas |
|
|
220 | (6) |
|
|
226 | (2) |
|
|
228 | (2) |
|
Getting XML Out of the Database: FOR XML |
|
|
230 | (7) |
|
|
230 | (6) |
|
|
236 | (1) |
|
|
236 | (1) |
|
|
237 | (1) |
|
Programming SQLXML from .NET and COM |
|
|
238 | (7) |
|
|
238 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
240 | (2) |
|
FOR XML: Server-Side and Client-Side |
|
|
242 | (1) |
|
|
242 | (1) |
|
Using Parameters with SQLXML |
|
|
243 | (1) |
|
Executing XPath or SQL Queries with Templates |
|
|
244 | (1) |
|
Interoperating with the ADO.NET Dataset |
|
|
244 | (1) |
|
|
245 | (1) |
|
|
245 | (2) |
|
SQL Server 2005 XML and XQuery Support |
|
|
247 | (40) |
|
|
248 | (9) |
|
Understanding How XML Is Stored by SQL Server |
|
|
249 | (1) |
|
|
250 | (4) |
|
Setting Permissions for Schema Creation |
|
|
254 | (1) |
|
|
255 | (1) |
|
Examining the XML Datatype Limitations |
|
|
256 | (1) |
|
Inserting Data into XML Columns |
|
|
257 | (3) |
|
|
257 | (2) |
|
|
259 | (1) |
|
Writing a Custom Query or Application |
|
|
259 | (1) |
|
|
260 | (9) |
|
|
260 | (6) |
|
|
266 | (2) |
|
|
268 | (1) |
|
|
269 | (1) |
|
Limitations of XML Modification |
|
|
270 | (1) |
|
Indexing XML for Performance |
|
|
270 | (3) |
|
Understanding How XML Indexing Works |
|
|
271 | (1) |
|
Examining Secondary XML Indexes |
|
|
272 | (1) |
|
Full-Text Search and the XML Datatype |
|
|
273 | (1) |
|
Dynamic Management Views and XML |
|
|
274 | (1) |
|
|
274 | (1) |
|
|
275 | (11) |
|
|
276 | (4) |
|
Using Advanced Web Services |
|
|
280 | (5) |
|
Monitoring Performance of XML Web Services |
|
|
285 | (1) |
|
|
286 | (1) |
|
SQL Server 2005 Reporting Services |
|
|
287 | (60) |
|
Reporting Services Components |
|
|
287 | (6) |
|
|
289 | (1) |
|
|
289 | (1) |
|
|
289 | (2) |
|
Report Manager Web Application |
|
|
291 | (1) |
|
Reporting Services Security |
|
|
292 | (1) |
|
Building a Basic Report with SSRS 2000 |
|
|
293 | (2) |
|
|
293 | (1) |
|
Working with Data Sources and Datasets |
|
|
293 | (1) |
|
Laying Out and Previewing the Report |
|
|
294 | (1) |
|
|
294 | (1) |
|
|
295 | (1) |
|
Upgrading from SQL Server 2000 Reporting Services |
|
|
295 | (1) |
|
Licensing Changes for Reporting Services |
|
|
296 | (1) |
|
SQL Server Management Studio Integration |
|
|
297 | (7) |
|
Walkthrough: Management Studio and Reporting Services |
|
|
298 | (6) |
|
|
304 | (3) |
|
|
305 | (2) |
|
Management and Execution Web Services |
|
|
307 | (1) |
|
Reporting Services Configuration Tool |
|
|
307 | (1) |
|
Report Design and Execution Improvements |
|
|
308 | (21) |
|
|
309 | (1) |
|
|
310 | (2) |
|
DatePicker for Date Values |
|
|
312 | (1) |
|
|
313 | (1) |
|
Analysis Services Integration |
|
|
314 | (1) |
|
Walkthrough: Building a Report in BIDS |
|
|
315 | (7) |
|
|
322 | (1) |
|
Data Source Changes: Expressions, XML/Web Services, SSIS, and SAP |
|
|
323 | (5) |
|
|
328 | (1) |
|
Visual Studio Integration and ReportViewer Controls |
|
|
329 | (8) |
|
|
329 | (3) |
|
Working with the ReportViewer Controls Programmatically |
|
|
332 | (4) |
|
LocalReport and ServerReport Objects |
|
|
336 | (1) |
|
|
337 | (1) |
|
End-User Ad Hoc Query and Reporting |
|
|
337 | (9) |
|
The Report Builder Client |
|
|
338 | (1) |
|
The Semantic Model Definition Language |
|
|
338 | (1) |
|
Walkthrough: Report Builder |
|
|
339 | (7) |
|
|
346 | (1) |
|
|
347 | (40) |
|
|
347 | (4) |
|
|
348 | (1) |
|
Performance, Scalability, Availability |
|
|
349 | (1) |
|
|
349 | (1) |
|
|
350 | (1) |
|
|
351 | (1) |
|
|
352 | (1) |
|
OLAP, OLTP, and Data Warehouses |
|
|
352 | (1) |
|
|
353 | (2) |
|
|
353 | (1) |
|
|
354 | (1) |
|
|
354 | (1) |
|
Dimensions and Attributes |
|
|
354 | (1) |
|
|
354 | (1) |
|
Analysis Services Projects |
|
|
355 | (27) |
|
|
356 | (3) |
|
|
359 | (1) |
|
Defining Data Source Views |
|
|
360 | (3) |
|
|
363 | (4) |
|
Deploying Projects and Configuring Projects for Deployment |
|
|
367 | (2) |
|
|
369 | (1) |
|
|
370 | (2) |
|
Browsing Cubes with Hierarchies |
|
|
372 | (2) |
|
|
374 | (2) |
|
|
376 | (3) |
|
Key Performance Indicators (KPIs) |
|
|
379 | (3) |
|
Analysis Services Scripting Language (ASSL) |
|
|
382 | (3) |
|
Example ASSL Object: A Data Source View with a Named Query |
|
|
382 | (2) |
|
|
384 | (1) |
|
|
385 | (2) |
|
|
387 | (32) |
|
|
387 | (1) |
|
Surface Area Configuration |
|
|
387 | (4) |
|
|
388 | (1) |
|
Dedicated Administrator Connection |
|
|
388 | (1) |
|
|
388 | (1) |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
389 | (1) |
|
|
390 | (1) |
|
|
390 | (1) |
|
|
390 | (1) |
|
|
390 | (1) |
|
|
390 | (1) |
|
|
390 | (1) |
|
|
391 | (1) |
|
Principals and Securables |
|
|
391 | (10) |
|
|
391 | (7) |
|
|
398 | (3) |
|
|
401 | (4) |
|
|
401 | (2) |
|
|
403 | (2) |
|
|
405 | (5) |
|
Imperative and Declarative CAS |
|
|
406 | (1) |
|
Using CAS with SQL Server |
|
|
406 | (4) |
|
|
410 | (5) |
|
The SQL Server 2005 Encryption Hierarchy |
|
|
411 | (1) |
|
Encryption with a User-supplied Password |
|
|
411 | (1) |
|
Encryption with a Symmetric Key |
|
|
412 | (1) |
|
Asymmetric Key Encryption |
|
|
413 | (1) |
|
Encryption with a Certificate |
|
|
414 | (1) |
|
Certificates and Web Services |
|
|
415 | (1) |
|
|
416 | (3) |
|
|
419 | (40) |
|
|
419 | (4) |
|
Service Broker Architecture |
|
|
420 | (2) |
|
|
422 | (1) |
|
Creating Service Broker Applications |
|
|
423 | (11) |
|
|
423 | (1) |
|
|
424 | (1) |
|
|
424 | (1) |
|
|
424 | (1) |
|
|
425 | (1) |
|
Creating Service Broker Stored Procedures |
|
|
425 | (3) |
|
A Simple Service Broker Example |
|
|
428 | (6) |
|
Service Broker Routing and Security |
|
|
434 | (23) |
|
Creating Distributed Service Broker Applications |
|
|
434 | (3) |
|
Distributed Service Broker Example |
|
|
437 | (20) |
|
|
457 | (2) |
|
Automation and Monitoring |
|
|
459 | (48) |
|
|
459 | (21) |
|
Step 1: Connect to SQL Server |
|
|
460 | (1) |
|
Step 2: Create the Agent Job |
|
|
461 | (4) |
|
|
465 | (8) |
|
|
473 | (1) |
|
|
474 | (2) |
|
Logging to the sysjobstepslogs Table |
|
|
476 | (1) |
|
WMI Events and Agent Alerts |
|
|
476 | (2) |
|
Agent Performance Counters |
|
|
478 | (1) |
|
|
479 | (1) |
|
|
480 | (8) |
|
Creating a Maintenance Plan |
|
|
481 | (1) |
|
|
482 | (1) |
|
Maintenance Plan Designer Document Window |
|
|
483 | (5) |
|
|
488 | (3) |
|
|
488 | (1) |
|
|
489 | (1) |
|
Using the Dedicated Admin Connection |
|
|
490 | (1) |
|
|
490 | (1) |
|
|
491 | (7) |
|
|
492 | (1) |
|
Configuring Database Mail |
|
|
493 | (4) |
|
|
497 | (1) |
|
|
498 | (7) |
|
Performance Monitor Correlation |
|
|
501 | (1) |
|
|
502 | (2) |
|
|
504 | (1) |
|
|
505 | (2) |
|
|
507 | (60) |
|
|
508 | (1) |
|
|
509 | (2) |
|
Connecting to SSIS in Management Studio |
|
|
509 | (2) |
|
Creating a New SSIS Project in BIDS |
|
|
511 | (1) |
|
|
511 | (19) |
|
Control Flow Design Surface |
|
|
512 | (2) |
|
|
514 | (12) |
|
Event Handlers Design Surface |
|
|
526 | (2) |
|
|
528 | (1) |
|
|
529 | (1) |
|
|
529 | (1) |
|
|
529 | (1) |
|
Control Flow Toolbox Tasks |
|
|
530 | (12) |
|
|
531 | (4) |
|
|
535 | (1) |
|
|
535 | (1) |
|
|
536 | (1) |
|
|
536 | (1) |
|
|
536 | (1) |
|
|
537 | (1) |
|
|
537 | (1) |
|
File Transfer Protocol Task |
|
|
538 | (1) |
|
|
538 | (1) |
|
|
538 | (1) |
|
|
539 | (1) |
|
|
539 | (3) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (8) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
544 | (6) |
|
|
550 | (4) |
|
|
554 | (2) |
|
Using the Package Configuration Organizer |
|
|
554 | (2) |
|
|
556 | (3) |
|
|
559 | (1) |
|
|
559 | (1) |
|
|
560 | (1) |
|
|
560 | (3) |
|
Control Flow Visual Debugging |
|
|
560 | (2) |
|
Data Flow Visual Debugging |
|
|
562 | (1) |
|
|
562 | (1) |
|
|
562 | (1) |
|
|
563 | (1) |
|
The SSIS Package Deployment Utility |
|
|
563 | (1) |
|
Migrating SQL Server 2000 Packages |
|
|
564 | (1) |
|
Scheduling an SSIS Package |
|
|
564 | (1) |
|
|
565 | (2) |
|
|
567 | (42) |
|
High Availability Defined |
|
|
568 | (1) |
|
Database Mirroring Overview |
|
|
569 | (2) |
|
Database Mirroring in Context |
|
|
571 | (1) |
|
Setting Up Database Mirroring |
|
|
572 | (15) |
|
Prerequisites, Connectivity, and Security |
|
|
573 | (3) |
|
Back Up and Restore the Principal Database |
|
|
576 | (1) |
|
Establish the Principal/Mirror Partnership |
|
|
577 | (1) |
|
Changing Transaction Safety Levels |
|
|
577 | (1) |
|
Database Mirroring States, Heartbeats, and Quorums |
|
|
578 | (1) |
|
|
579 | (1) |
|
Suspending and Resuming Mirroring |
|
|
579 | (1) |
|
Terminating Database Mirroring |
|
|
580 | (1) |
|
Full-Text Indexing and Mirroring |
|
|
580 | (1) |
|
Service Broker and Database Mirroring |
|
|
580 | (1) |
|
Setting Up Mirroring Using Management Studio |
|
|
581 | (6) |
|
Client Applications and Database Mirroring |
|
|
587 | (1) |
|
Monitoring Database Mirroring |
|
|
588 | (6) |
|
|
588 | (4) |
|
Performance Monitor Counters |
|
|
592 | (1) |
|
|
593 | (1) |
|
Windows Event Log and SQL Server Error Log |
|
|
593 | (1) |
|
Performance Considerations for Mirroring |
|
|
594 | (1) |
|
Limitations of Database Mirroring |
|
|
594 | (1) |
|
Sample Application Walk-Through |
|
|
595 | (6) |
|
Database Snapshots and Mirroring |
|
|
601 | (5) |
|
Database Snapshots Overview |
|
|
601 | (2) |
|
Working with Snapshots in T-SQL |
|
|
603 | (1) |
|
Performance Considerations When Using Snapshots on Mirrors |
|
|
604 | (1) |
|
Using, Monitoring, and Managing Database Snapshots |
|
|
604 | (1) |
|
Programming Database Snapshots |
|
|
605 | (1) |
|
Limitations of Database Snapshots |
|
|
605 | (1) |
|
Windows Clustering in SQL Server 2005 |
|
|
606 | (1) |
|
Replication in SQL Server 2005 |
|
|
607 | (1) |
|
|
607 | (2) |
|
|
609 | (36) |
|
Notification Services Architecture |
|
|
610 | (2) |
|
|
611 | (1) |
|
|
611 | (1) |
|
|
611 | (1) |
|
|
612 | (1) |
|
Building a Notification Services Application |
|
|
612 | (21) |
|
Defining an NS Instance: The Instance Configuration File |
|
|
613 | (4) |
|
Defining the NS Application: The Application Definition File |
|
|
617 | (16) |
|
Compiling and Running Your NS Application |
|
|
633 | (3) |
|
Monitoring and Troubleshooting Your NS Application |
|
|
636 | (3) |
|
Programmatically Working with NS |
|
|
639 | (4) |
|
Programming NS from Visual Studio |
|
|
639 | (3) |
|
Managing NS Programmatically |
|
|
642 | (1) |
|
|
643 | (2) |
Index |
|
645 | |