Introduction |
|
xxiii | |
|
Part I Basic Concepts and Installation |
|
|
|
Chapter 1 Relational Database Systems: An Introduction |
|
|
3 | (18) |
|
Database Systems: An Overview |
|
|
4 | (3) |
|
Variety of User Interfaces |
|
|
5 | (1) |
|
Physical Data Independence |
|
|
5 | (1) |
|
Logical Data Independence |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
Relational Database Systems |
|
|
7 | (4) |
|
Working with the Book's Sample Database |
|
|
8 | (3) |
|
SQL: A Relational Database Language |
|
|
11 | (1) |
|
|
11 | (5) |
|
|
12 | (2) |
|
Entity-Relationship Model |
|
|
14 | (2) |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
18 | (3) |
|
Chapter 2 Planning the Installation and Installing SQL Server |
|
|
21 | (22) |
|
SQL Server Editions and Management Components |
|
|
22 | (2) |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
24 | (7) |
|
|
24 | (4) |
|
Planning the Installation |
|
|
28 | (3) |
|
|
31 | (10) |
|
|
41 | (2) |
|
Chapter 3 SQL Server Management Studio |
|
|
43 | (28) |
|
Introduction to SQL Server Management Studio |
|
|
44 | (4) |
|
|
45 | (2) |
|
|
47 | (1) |
|
|
47 | (1) |
|
Organizing and Navigating SQL Server Management Studio's Panes |
|
|
47 | (1) |
|
Using SQL Server Management Studio with the Database Engine |
|
|
48 | (12) |
|
Administering Database Servers |
|
|
49 | (3) |
|
Managing Databases Using Object Explorer |
|
|
52 | (8) |
|
Authoring Activities Using SQL Server Management Studio |
|
|
60 | (6) |
|
|
61 | (2) |
|
|
63 | (1) |
|
|
64 | (2) |
|
|
66 | (1) |
|
|
67 | (4) |
|
Part II Transact-SQL Language |
|
|
|
|
71 | (24) |
|
|
72 | (3) |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
75 | (7) |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
76 | (2) |
|
|
78 | (3) |
|
|
81 | (1) |
|
|
82 | (8) |
|
|
83 | (1) |
|
|
83 | (7) |
|
|
90 | (2) |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
93 | (2) |
|
Chapter 5 Data Definition Language |
|
|
95 | (38) |
|
Creating Database Objects |
|
|
96 | (20) |
|
|
96 | (4) |
|
Create Table: A Basic Form |
|
|
100 | (3) |
|
Create Table and Declarative Integrity Constraints |
|
|
103 | (6) |
|
|
109 | (4) |
|
Creating Other Database Objects |
|
|
113 | (1) |
|
Integrity Constraints and Domains |
|
|
114 | (2) |
|
Modifying Database Objects |
|
|
116 | (12) |
|
|
117 | (7) |
|
|
124 | (4) |
|
Removing Database Objects |
|
|
128 | (1) |
|
|
129 | (1) |
|
|
129 | (4) |
|
|
133 | (76) |
|
Select Statement: Its Clauses and Functions |
|
|
134 | (38) |
|
|
136 | (13) |
|
|
149 | (2) |
|
|
151 | (7) |
|
|
158 | (1) |
|
|
159 | (2) |
|
Select Statement and Identity Property |
|
|
161 | (2) |
|
Create Sequence Statement |
|
|
163 | (2) |
|
|
165 | (5) |
|
|
170 | (2) |
|
|
172 | (5) |
|
Subqueries and Comparison Operators |
|
|
173 | (1) |
|
Subqueries and the IN Operator |
|
|
174 | (2) |
|
Subqueries and ANY and ALL Operators |
|
|
176 | (1) |
|
|
177 | (1) |
|
|
178 | (13) |
|
Two Syntax Forms to Implement Joins |
|
|
179 | (1) |
|
|
180 | (5) |
|
|
185 | (1) |
|
|
186 | (3) |
|
Further Forms of Join Operations |
|
|
189 | (2) |
|
|
191 | (4) |
|
Subqueries and the EXISTS Function |
|
|
192 | (2) |
|
Should You Use Joins or Subqueries? |
|
|
194 | (1) |
|
|
195 | (8) |
|
|
195 | (2) |
|
|
197 | (6) |
|
|
203 | (1) |
|
|
204 | (5) |
|
Chapter 7 Modification of a Table's Contents |
|
|
209 | (18) |
|
|
210 | (5) |
|
|
210 | (3) |
|
|
213 | (1) |
|
Table Value Constructors and Insert |
|
|
214 | (1) |
|
|
215 | (2) |
|
|
217 | (2) |
|
Other T-SQL Modification Statements and Clauses |
|
|
219 | (6) |
|
|
219 | (1) |
|
|
220 | (1) |
|
|
221 | (4) |
|
|
225 | (1) |
|
|
225 | (2) |
|
Chapter 8 Stored Procedures and User-Defined Functions |
|
|
227 | (30) |
|
|
228 | (8) |
|
|
228 | (1) |
|
|
229 | (1) |
|
|
230 | (1) |
|
|
231 | (1) |
|
Miscellaneous Procedural Statements |
|
|
232 | (1) |
|
Exception Handling with TRY, CATCH, and THROW |
|
|
233 | (3) |
|
|
236 | (11) |
|
Creation and Execution of Stored Procedures |
|
|
236 | (6) |
|
Stored Procedures and CLR |
|
|
242 | (5) |
|
|
247 | (9) |
|
Creation and Execution of User-Defined Functions |
|
|
247 | (7) |
|
Changing the Structure of UDFs |
|
|
254 | (1) |
|
User-Defined Functions and CLR |
|
|
254 | (2) |
|
|
256 | (1) |
|
|
256 | (1) |
|
|
257 | (12) |
|
Introduction to the System Catalog |
|
|
258 | (2) |
|
|
260 | (5) |
|
|
260 | (3) |
|
Dynamic Management Views and Functions |
|
|
263 | (1) |
|
|
263 | (2) |
|
|
265 | (3) |
|
|
265 | (1) |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
268 | (1) |
|
|
268 | (1) |
|
|
269 | (20) |
|
|
270 | (4) |
|
|
272 | (1) |
|
|
273 | (1) |
|
|
274 | (8) |
|
|
274 | (4) |
|
Editing Index Information |
|
|
278 | (2) |
|
|
280 | (2) |
|
Removing and Renaming Indices |
|
|
282 | (1) |
|
Guidelines for Creating and Using Indices |
|
|
282 | (3) |
|
Indices and Conditions in the Where Clause |
|
|
283 | (1) |
|
Indices and the Join Operator |
|
|
284 | (1) |
|
|
284 | (1) |
|
|
285 | (1) |
|
|
285 | (1) |
|
|
286 | (3) |
|
|
289 | (16) |
|
|
290 | (5) |
|
|
290 | (4) |
|
Altering and Removing Views |
|
|
294 | (1) |
|
|
295 | (7) |
|
|
295 | (1) |
|
Insert Statement and a View |
|
|
296 | (3) |
|
Update Statement and a View |
|
|
299 | (2) |
|
Delete Statement and a View |
|
|
301 | (1) |
|
Editing Information Concerning Views |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
303 | (2) |
|
Chapter 12 Security System of the Database Engine |
|
|
305 | (48) |
|
|
307 | (11) |
|
|
308 | (1) |
|
|
309 | (1) |
|
|
310 | (1) |
|
|
311 | (1) |
|
Extensible Key Management |
|
|
311 | (1) |
|
Methods of Data Encryption |
|
|
312 | (6) |
|
|
318 | (4) |
|
Setting Up the Database System Security |
|
|
319 | (3) |
|
|
322 | (4) |
|
|
322 | (1) |
|
DDL Schema-Related Statements |
|
|
323 | (2) |
|
|
325 | (1) |
|
|
326 | (2) |
|
Managing Database Security Using SQL Server Management Studio |
|
|
326 | (1) |
|
Managing Database Security Using Transact-SQL Statements |
|
|
327 | (1) |
|
|
328 | (8) |
|
|
328 | (2) |
|
|
330 | (2) |
|
|
332 | (2) |
|
User-Defined Server Roles |
|
|
334 | (1) |
|
User-Defined Database Roles |
|
|
334 | (2) |
|
|
336 | (10) |
|
|
336 | (4) |
|
|
340 | (2) |
|
|
342 | (1) |
|
Managing Permissions Using SQL Server Management Studio |
|
|
343 | (1) |
|
Managing Authorization and Authentication of Contained Databases |
|
|
343 | (3) |
|
|
346 | (3) |
|
|
349 | (1) |
|
|
350 | (1) |
|
|
351 | (2) |
|
Chapter 13 Concurrency Control |
|
|
353 | (26) |
|
|
354 | (1) |
|
|
355 | (7) |
|
Properties of Transactions |
|
|
356 | (1) |
|
Transact-SQL Statements and Transactions |
|
|
357 | (3) |
|
|
360 | (2) |
|
|
362 | (8) |
|
|
363 | (2) |
|
|
365 | (1) |
|
|
366 | (1) |
|
|
367 | (1) |
|
Displaying Lock Information |
|
|
368 | (1) |
|
|
369 | (1) |
|
|
370 | (3) |
|
|
370 | (1) |
|
The Database Engine and Isolation Levels |
|
|
371 | (2) |
|
|
373 | (2) |
|
Read Committed Snapshot Isolation |
|
|
374 | (1) |
|
|
374 | (1) |
|
|
375 | (1) |
|
|
376 | (3) |
|
|
379 | (20) |
|
|
380 | (3) |
|
|
380 | (1) |
|
Modifying a Trigger's Structure |
|
|
381 | (1) |
|
Using deleted and inserted Virtual Tables |
|
|
382 | (1) |
|
Application Areas for DML Triggers |
|
|
383 | (6) |
|
|
383 | (4) |
|
|
387 | (1) |
|
|
388 | (1) |
|
DDL Triggers and Their Application Areas |
|
|
389 | (3) |
|
|
390 | (1) |
|
|
391 | (1) |
|
|
392 | (3) |
|
|
395 | (1) |
|
|
395 | (4) |
|
Part III SQL Server: System Administration |
|
|
|
Chapter 15 System Environment of the Database Engine |
|
|
399 | (22) |
|
|
400 | (2) |
|
|
400 | (1) |
|
|
401 | (1) |
|
|
401 | (1) |
|
|
402 | (1) |
|
|
402 | (7) |
|
|
403 | (3) |
|
|
406 | (2) |
|
Parallel Processing of Tasks |
|
|
408 | (1) |
|
Utilities and the DBCC Command |
|
|
409 | (6) |
|
|
409 | (1) |
|
|
410 | (3) |
|
|
413 | (1) |
|
|
413 | (2) |
|
|
415 | (3) |
|
|
415 | (1) |
|
Using Policy-Based Management |
|
|
416 | (2) |
|
|
418 | (1) |
|
|
419 | (2) |
|
Chapter 16 Backup, Recovery, and System Availability |
|
|
421 | (38) |
|
|
422 | (1) |
|
Introduction to Backup Methods |
|
|
423 | (3) |
|
|
424 | (1) |
|
|
424 | (1) |
|
|
424 | (1) |
|
|
425 | (1) |
|
Performing Database Backup |
|
|
426 | (8) |
|
Backing Up Using Transact-SQL Statements |
|
|
426 | (4) |
|
Backing Up Using SQL Server Management Studio |
|
|
430 | (1) |
|
Determining Which Databases to Back Up |
|
|
431 | (3) |
|
Performing Database Recovery |
|
|
434 | (12) |
|
|
434 | (1) |
|
|
434 | (9) |
|
|
443 | (3) |
|
|
446 | (8) |
|
|
447 | (1) |
|
|
448 | (1) |
|
|
449 | (1) |
|
|
450 | (1) |
|
|
451 | (1) |
|
|
451 | (2) |
|
Comparison of High-Availability Components |
|
|
453 | (1) |
|
|
454 | (2) |
|
|
456 | (1) |
|
|
457 | (2) |
|
Chapter 17 Automating System Administration Tasks |
|
|
459 | (18) |
|
Starting SQL Server Agent |
|
|
461 | (1) |
|
Creating Jobs and Operators |
|
|
462 | (7) |
|
Creating a Job and Its Steps |
|
|
462 | (2) |
|
|
464 | (2) |
|
Notifying Operators About the Job Status |
|
|
466 | (2) |
|
Viewing the Job History Log |
|
|
468 | (1) |
|
|
469 | (6) |
|
|
469 | (1) |
|
SQL Server Agent Error Log |
|
|
470 | (1) |
|
|
471 | (1) |
|
Defining Alerts to Handle Errors |
|
|
471 | (4) |
|
|
475 | (1) |
|
|
476 | (1) |
|
Chapter 18 Data Replication |
|
|
477 | (20) |
|
Distributed Data and Methods for Distributing |
|
|
478 | (1) |
|
SQL Server Replication: An Overview |
|
|
479 | (12) |
|
Publishers, Distributors, and Subscribers |
|
|
480 | (1) |
|
Publications and Articles |
|
|
481 | (2) |
|
|
483 | (1) |
|
The distribution Database |
|
|
483 | (1) |
|
|
484 | (4) |
|
|
488 | (3) |
|
|
491 | (4) |
|
Configuring the Distribution and Publication Servers |
|
|
491 | (2) |
|
|
493 | (1) |
|
Configuring Subscription Servers |
|
|
494 | (1) |
|
|
495 | (1) |
|
|
495 | (2) |
|
Chapter 19 Query Optimizer |
|
|
497 | (34) |
|
Phases of Query Processing |
|
|
498 | (1) |
|
How Query Optimization Works |
|
|
499 | (8) |
|
|
500 | (1) |
|
|
500 | (4) |
|
|
504 | (1) |
|
Join Processing Techniques |
|
|
504 | (2) |
|
|
506 | (1) |
|
Tools for Editing the Optimizer Strategy |
|
|
507 | (13) |
|
|
508 | (3) |
|
SQL Server Management Studio and Graphical Execution Plans |
|
|
511 | (1) |
|
Examples of Execution Plans |
|
|
512 | (5) |
|
Dynamic Management Views and Query Optimizer |
|
|
517 | (3) |
|
|
520 | (9) |
|
|
520 | (1) |
|
|
521 | (8) |
|
|
529 | (2) |
|
Chapter 20 Performance Tuning |
|
|
531 | (44) |
|
Factors That Affect Performance |
|
|
532 | (8) |
|
Database Applications and Performance |
|
|
533 | (2) |
|
The Database Engine and Performance |
|
|
535 | (1) |
|
System Resources and Performance |
|
|
536 | (4) |
|
|
540 | (9) |
|
Performance Monitor An Overview |
|
|
540 | (2) |
|
|
542 | (2) |
|
|
544 | (2) |
|
Monitoring the Disk System |
|
|
546 | (2) |
|
Monitoring the Network Interface |
|
|
548 | (1) |
|
Choosing the Right Tool for Monitoring |
|
|
549 | (9) |
|
|
550 | (1) |
|
Database Engine Tuning Advisor |
|
|
550 | (8) |
|
Other Performance Tools of the Database Engine |
|
|
558 | (15) |
|
|
559 | (8) |
|
Performance Data Collector |
|
|
567 | (2) |
|
|
569 | (4) |
|
|
573 | (1) |
|
|
573 | (1) |
|
|
574 | (1) |
|
Chapter 21 In-Memory OLTP |
|
|
575 | (22) |
|
|
576 | (3) |
|
Pinned Tables as Predecessor of Memory-Optimized Tables |
|
|
577 | (1) |
|
Creating Memory-Optimized Tables |
|
|
577 | (2) |
|
|
579 | (4) |
|
|
580 | (1) |
|
|
580 | (3) |
|
In-Memory OLTP and Concurrency Control |
|
|
583 | (1) |
|
Logging Memory-Optimized Objects |
|
|
583 | (1) |
|
Optimistic Multiversion Concurrency Control |
|
|
584 | (1) |
|
Accessing the Content of Memory-Optimized Tables |
|
|
584 | (2) |
|
|
584 | (1) |
|
Compiled Stored Procedures |
|
|
585 | (1) |
|
Editing Information Concerning In-Memory Objects |
|
|
586 | (3) |
|
|
586 | (1) |
|
|
587 | (1) |
|
|
588 | (1) |
|
|
589 | (4) |
|
Memory Management for In-Memory OLTP: Overview |
|
|
589 | (1) |
|
|
589 | (2) |
|
Migration Tools for In-Memory OLTP |
|
|
591 | (2) |
|
|
593 | (4) |
|
Part IV SQL Server and Business Intelligence |
|
|
|
Chapter 22 Business Intelligence: An Introduction |
|
|
597 | (16) |
|
Online Transaction Processing vs. Business Intelligence |
|
|
598 | (2) |
|
Online Transaction Processing |
|
|
598 | (1) |
|
Business Intelligence Systems |
|
|
599 | (1) |
|
Data Warehouses and Data Marts |
|
|
600 | (2) |
|
|
602 | (4) |
|
Cubes and Their Architectures |
|
|
606 | (4) |
|
|
607 | (2) |
|
Physical Storage of a Cube |
|
|
609 | (1) |
|
|
610 | (1) |
|
|
610 | (1) |
|
|
611 | (2) |
|
Chapter 23 SQL Server Analysis Services |
|
|
613 | (42) |
|
|
616 | (23) |
|
Multidimensional Model Terminology |
|
|
616 | (2) |
|
|
618 | (1) |
|
Creating and Processing a Multidimensional Cube |
|
|
619 | (11) |
|
Delivering Data from the Multidimensional Model |
|
|
630 | (9) |
|
|
639 | (13) |
|
|
640 | (1) |
|
Creating a Tabular Model Solution |
|
|
641 | (3) |
|
Deploying and Processing the Tabular Project |
|
|
644 | (3) |
|
Delivering Data from the Tabular Project |
|
|
647 | (5) |
|
Multidimensional Model vs. Tabular Model |
|
|
652 | (1) |
|
Analysis Services: Data Security |
|
|
653 | (1) |
|
|
654 | (1) |
|
|
654 | (1) |
|
Chapter 24 Business Intelligence and Transact-SQL |
|
|
655 | (32) |
|
|
656 | (7) |
|
|
658 | (2) |
|
|
660 | (3) |
|
|
663 | (7) |
|
|
663 | (3) |
|
|
666 | (1) |
|
|
667 | (2) |
|
|
669 | (1) |
|
|
670 | (4) |
|
|
670 | (3) |
|
Statistical Aggregate Functions |
|
|
673 | (1) |
|
Standard and Nonstandard Analytic Functions |
|
|
674 | (10) |
|
|
675 | (2) |
|
|
677 | (2) |
|
|
679 | (1) |
|
|
680 | (4) |
|
|
684 | (1) |
|
|
684 | (3) |
|
Chapter 25 SQL Server Reporting Services |
|
|
687 | (34) |
|
|
688 | (1) |
|
SQL Server Reporting Services Architecture |
|
|
689 | (3) |
|
Reporting Services Windows Service |
|
|
690 | (1) |
|
|
691 | (1) |
|
Installation and Configuration of Reporting Services |
|
|
692 | (3) |
|
|
692 | (2) |
|
|
694 | (1) |
|
|
695 | (18) |
|
Creating Your First Report |
|
|
695 | (9) |
|
Creating a Parameterized Report |
|
|
704 | (4) |
|
Creating a Report Using a Chart |
|
|
708 | (5) |
|
Managing and Tuning Reports |
|
|
713 | (4) |
|
Reporting Services Web Portal |
|
|
714 | (2) |
|
|
716 | (1) |
|
Reporting Services Security |
|
|
717 | (1) |
|
|
718 | (1) |
|
|
718 | (1) |
|
|
718 | (1) |
|
|
719 | (2) |
|
Chapter 26 Optimizing Techniques for Data Warehousing |
|
|
721 | (20) |
|
|
722 | (10) |
|
How the Database Engine Partitions Data |
|
|
723 | (1) |
|
Steps for Creating Partitioned Tables |
|
|
723 | (6) |
|
Partitioning Techniques for Increasing System Performance |
|
|
729 | (2) |
|
Guidelines for Partitioning Tables and Indices |
|
|
731 | (1) |
|
|
732 | (2) |
|
Indexed or Materialized Views |
|
|
734 | (5) |
|
|
735 | (2) |
|
Modifying the Structure of an Indexed View |
|
|
737 | (1) |
|
Editing Information Concerning Indexed Views |
|
|
737 | (1) |
|
Benefits of Indexed Views |
|
|
738 | (1) |
|
|
739 | (2) |
|
Chapter 27 Columnstore Indices |
|
|
741 | (14) |
|
Benefits of Columnstore Indices |
|
|
742 | (1) |
|
Storage of Columnstore Indices |
|
|
743 | (1) |
|
|
743 | (1) |
|
|
744 | (1) |
|
|
744 | (1) |
|
Types of Columnstore Indices |
|
|
745 | (5) |
|
Clustered Columnstore Index |
|
|
745 | (4) |
|
Nonclustered Columnstore Index |
|
|
749 | (1) |
|
|
750 | (1) |
|
|
751 | (4) |
|
Part V Beyond Relational Data |
|
|
|
Chapter 28 XML and JSON Integration in the Database Engine |
|
|
755 | (40) |
|
|
756 | (9) |
|
|
758 | (1) |
|
|
759 | (1) |
|
|
760 | (1) |
|
|
761 | (1) |
|
|
761 | (1) |
|
|
762 | (1) |
|
|
762 | (2) |
|
|
764 | (1) |
|
Storing XML Documents in the Database Engine |
|
|
765 | (9) |
|
Storing XML Documents Using the XML Data Type |
|
|
767 | (6) |
|
Storing XML Documents Using Decomposition |
|
|
773 | (1) |
|
Presenting and Querying XML Documents |
|
|
774 | (9) |
|
Presenting XML Documents as Relational Data |
|
|
774 | (1) |
|
Presenting Relational Data as XML Documents |
|
|
775 | (7) |
|
|
782 | (1) |
|
|
783 | (2) |
|
|
784 | (1) |
|
|
785 | (1) |
|
Storing JSON Documents in the Database Engine |
|
|
785 | (2) |
|
Presenting and Querying JSON Documents |
|
|
787 | (5) |
|
Presenting JSON Documents as Relational Data |
|
|
787 | (1) |
|
Presenting Relational Data as JSON Documents |
|
|
788 | (2) |
|
|
790 | (2) |
|
|
792 | (3) |
|
Chapter 29 Spatial and Temporal Data |
|
|
795 | (26) |
|
|
796 | (5) |
|
Models for Representing Spatial Data |
|
|
797 | (1) |
|
|
797 | (2) |
|
|
799 | (1) |
|
|
800 | (1) |
|
|
800 | (1) |
|
Working with Spatial Data Types |
|
|
801 | (10) |
|
Working with the Geometry Data Type |
|
|
801 | (4) |
|
Working with the Geography Data Type |
|
|
805 | (1) |
|
|
806 | (4) |
|
Editing Information Concerning Spatial Data |
|
|
810 | (1) |
|
|
811 | (8) |
|
Creation of Temporal Tables |
|
|
812 | (1) |
|
Temporal Tables and DML Statements |
|
|
813 | (2) |
|
|
815 | (3) |
|
Converting Convenient Tables in Temporal Tables |
|
|
818 | (1) |
|
|
819 | (2) |
|
Chapter 30 SQL Server Full-Text Search |
|
|
821 | (22) |
|
|
822 | (5) |
|
Tokens, Word Breakers, and Stop Lists |
|
|
823 | (1) |
|
|
824 | (1) |
|
|
825 | (1) |
|
|
826 | (1) |
|
|
827 | (5) |
|
Indexing Full-Text Data Using Transact-SQL |
|
|
827 | (3) |
|
Indexing Full-Text Data Using SQL Server Management Studio |
|
|
830 | (2) |
|
|
832 | (8) |
|
|
832 | (1) |
|
|
833 | (2) |
|
|
835 | (1) |
|
|
836 | (2) |
|
Searching Extended Properties |
|
|
838 | (2) |
|
Editing Information Concerning Full-Text Data |
|
|
840 | (1) |
|
|
841 | (1) |
|
|
842 | (1) |
Index |
|
843 | |