| Acknowledgments | xxiii |
| Introduction | xxv |
| Part I | Mastering Transact-SQL | |
| 1 | An Overview of SQL Server 2000 | 3 |
| SQL Server's Networked Architecture | 4 |
| SQL Server's Basic Components | 8 |
| Transact-SQL | 9 |
| SQL Server Database Architecture | 9 |
| Administrative Components | 22 |
| A Brief Development History of SQL Server | 27 |
| What's New with SQL Server 2000 | 28 |
| Conclusion | 33 |
| 2 | Data Definition Language Basics | 35 |
| Introduction to SQL | 36 |
| Creating a Database | 46 |
| Creating a Table | 50 |
| Creating a View | 70 |
| Re-creating a View | 78 |
| Creating an Index | 78 |
| Dropping Databases, Tables, Views, and Indexes | 80 |
| The SQL Catalog and Information Schema | 80 |
| DDL Coding Suggestions | 83 |
| Conclusion | 86 |
| Additional Resources | 86 |
| 3 | Advanced Database Definition | 87 |
| Specifying Database File Locations and Sizes | 88 |
| Altering a Database | 90 |
| Defining Filegroups | 90 |
| Cascading Foreign Key Constraints | 93 |
| More View Examples | 95 |
| Indexes Over Computed Columns and Views | 106 |
| Using the Query Analyzer | 109 |
| Adding Extended Object Properties | 117 |
| Conclusion | 120 |
| 4 | Data Manipulation Language Basics | 121 |
| Introduction to DML | 122 |
| Retrieving Rows with the Select Statement | 123 |
| Using DML to Modify Table Data | 154 |
| DML Coding Suggestions | 160 |
| Conclusion | 161 |
| 5 | Advanced DML Statement Features | 163 |
| Complex Select Statements | 164 |
| Performance Hints | 202 |
| Concurrent Access and Resource Locks | 203 |
| DML Coding Suggestions | 211 |
| Conclusion | 211 |
| 6 | Writing Stored Procedures, Triggers, and Functions | 213 |
| Stored Procedures | 214 |
| Triggers | 232 |
| User-Defined Functions | 245 |
| Debugging Stored Procedures, Triggers, and User-Defined Functions | 250 |
| Conclusion | 253 |
| 7 | Developing Extended Stored Procedures | 255 |
| Extended Stored Procedures | 256 |
| OLE Automation Stored Procedures | 276 |
| Conclusion | 283 |
| Additional References | 283 |
| Part II | Windows Applications | |
| 8 | Using ADO | 287 |
| OLE DB and Universal Data Access | 288 |
| OLE DB Architecture Overview | 288 |
| ADO (ActiveX Data Objects) | 291 |
| OLE DB and ADO Files | 293 |
| ADO Architecture | 293 |
| Adding the ADO Reference to Visual Basic | 295 |
| Using ADO Objects with Visual Basic | 296 |
| Advanced Database Functions Using ADO | 352 |
| Conclusion | 380 |
| Additional References | 380 |
| 9 | Using the ODBC API | 381 |
| ODBC Architecture | 383 |
| Configuring an ODBC Data Source | 385 |
| Conclusion | 426 |
| Additional References | 426 |
| 10 | Using DAO | 427 |
| DAO Files | 429 |
| DAO Architecture | 430 |
| An Overview of Using DAO | 432 |
| Adding the DAO Reference to Visual Basic | 432 |
| Using DAO Objects with Visual Basic | 433 |
| General Performance Tips for DAO and ODBC | 488 |
| Conclusion | 489 |
| Additional References | 489 |
| 11 | Using ODBCDirect | 491 |
| ODBCDirect Files | 493 |
| ODBCDirect Architecture | 493 |
| Adding the DAO Reference to Visual Basic | 494 |
| An Overview of Using ODBCDirect | 495 |
| Creating the DBEngine Object | 496 |
| Creating an ODBCDirect Workspace Object | 496 |
| Ending the DBEngine Object | 497 |
| Connecting to SQL Server | 497 |
| Retrieving Data with ODBCDirect | 501 |
| Modifying Data with ODBCDirect | 513 |
| Advanced Database Functions Using ODBCDirect | 521 |
| Conclusion | 528 |
| Additional References | 529 |
| 12 | Using RDO | 531 |
| RDO Files | 534 |
| RDO Architecture | 534 |
| An Overview of Using RDO | 535 |
| Adding RDO 2.0 Objects to Visual Basic | 536 |
| Using the RDO Objects with Visual Basic | 537 |
| Advanced Topics | 563 |
| Conclusion | 570 |
| Additional References | 571 |
| Part III | Web Applications | |
| 13 | Using the Web Wizard | 575 |
| Web Integration Using the Web Assistant Wizard | 576 |
| Conclusion | 591 |
| 14 | Using ASP and ADO | 593 |
| Web and Database Integration Using ASP | 594 |
| The ASP Object Model | 597 |
| ASP Basics | 599 |
| Using ADO Objects with ASP | 601 |
| Advanced ADO-based Web Building Techniques | 641 |
| Conclusion | 649 |
| Additional References | 650 |
| 15 | Using XML | 651 |
| XML Basics | 653 |
| SQL Server 2000's Support for XML | 655 |
| Using XML Streams and ADO | 684 |
| Conclusion | 692 |
| Additional Resources | 692 |
| Part IV | Management and Analysis Applications | |
| 16 | Using SQL-DMO | 695 |
| Distributed Management Framework | 696 |
| SQL-DMO Files | 705 |
| Using SQL-DMO | 705 |
| Building the SQL-DMO Sample Application | 713 |
| Conclusion | 734 |
| 17 | Developing Applications Using DTS | 735 |
| An Overview of DTS | 736 |
| Creating DTS Packages with the DTS Designer | 742 |
| DTS Command Line Options | 760 |
| Programming with DTS | 762 |
| DTS Architecture | 762 |
| Conclusion | 781 |
| Additional References | 781 |
| 18 | Full-Text Search and English Query | 783 |
| Full-Text Catalogs and Searches | 784 |
| English Query | 794 |
| Conclusion | 831 |
| Part V | Administration for the Developer | |
| 19 | Managing Servers | 835 |
| Overview of a SQL Server Installation | 836 |
| Setting Enterprise Manager Properties | 847 |
| Registering and Unregistering a Server | 849 |
| Stopping, Starting, Pausing, and Continuing a Server | 854 |
| Setting Server Properties | 855 |
| Server Logins and Roles | 874 |
| Working with SQL Server Agent | 875 |
| Displaying Event Logs | 891 |
| Viewing and Creating SQL Server Messages | 892 |
| Working with Linked Servers | 894 |
| Other Enterprise Manager Facilities | 897 |
| Conclusion | 897 |
| 20 | Managing Databases | 899 |
| Managing Databases and Database Objects | 900 |
| Copy Database Wizard | 927 |
| Conclusion | 933 |
| 21 | SQL Server Security | 935 |
| Security Basics | 936 |
| Setting Up Database Users | 947 |
| Managing SQL Server Database Access | 977 |
| Using Stored Procedures | 980 |
| Permissions | 984 |
| The Grant, Revoke, and Deny SQL Statements | 993 |
| Role Permissions | 998 |
| Stored Procedures and Permissions | 999 |
| Ownership Chain | 1000 |
| Database Security Principles and Guidelines | 1000 |
| Conclusion | 1002 |
| 22 | Backup and Recovery | 1003 |
| Why Back Up the Database? | 1004 |
| Backing Up Database Objects | 1005 |
| Database Recovery | 1025 |
| Backup and Recovery Server Options | 1035 |
| Using a Standby Server | 1036 |
| Conclusion | 1036 |
| 23 | Database Performance Troubleshooting | 1037 |
| Selecting the Appropriate Tool | 1039 |
| SQL Profiler | 1042 |
| Windows 2000 Server System Monitor | 1073 |
| Enterprise Manager Current Activity Categories | 1096 |
| Index Tuning Wizard | 1099 |
| Showplan | 1106 |
| Other Performance Tools | 1114 |
| SQL Statement Hints | 1118 |
| Hardware Considerations | 1125 |
| Conclusion | 1126 |
| Part VI | Relational Database Concepts | |
| 24 | Introduction to the Relational Database Model | 1129 |
| Background: Database Management Systems | 1130 |
| The Relational Database Model | 1135 |
| Conclusion | 1157 |
| Additional Resources | 1158 |
| 25 | Introduction to Entity Relationship Diagrams (ERDs) | 1159 |
| ERDs--A Design Tool | 1160 |
| Basic ERD Concepts and Symbols | 1160 |
| Adding Properties to ERDs | 1163 |
| Multivalued Properties | 1165 |
| Representing Associations | 1166 |
| Exclusive Relationships | 1167 |
| Entity Subtypes | 1168 |
| When to Use ERDs | 1169 |
| SQL Server Database Diagrams | 1171 |
| Conclusion | 1178 |
| Additional Resources | 1179 |
| Part VII | Appendixes | |
| A | Maximum Capacities | 1183 |
| System Capacities | 1184 |
| Database Capacities | 1184 |
| SQL Capacities | 1185 |
| B | Creating and Editing UDL Files | 1187 |
| Creating UDL Files on Windows 9x and NT Using Explorer | 1190 |
| Creating UDL Files on Windows 2000 Using Explorer | 1191 |
| Creating UDL Files Using the Data Link API | 1192 |
| Conclusion | 1195 |
| Index | 1197 |