You are previewing Microsoft® SQL Server™ 2000 Unleashed, Second Edition.
O'Reilly logo
Microsoft® SQL Server™ 2000 Unleashed, Second Edition

Book Description

Microsoft SQL Server 2000 Unleashed, 2E offers a variety of topics for system and database administrators to help them learn new features of the product and to solve problems they face on a daily basis. It shows them how to build upon their working knowledge of the product and take their experience and knowledge to a higher level. This new edition of Microsoft SQL Server 2000 Unleashed covers the latest updates and service packs to SQL Server 2000, including full support for XML, notification services, and SQL Server CE.

Table of Contents

  1. Copyright
  2. About the Lead Authors
  3. Acknowledgments
  4. Introduction
  5. Welcome to Microsoft SQL Server
    1. The Microsoft SQL Server Environment
      1. Overview of Client/Server
      2. SQL Server 2000 Components and Features
      3. Summary
    2. SQL Server 2000 Environments and Editions
      1. SQL Server 2000 Environments
      2. SQL Server 2000 Editions
      3. SQL Server Licensing Models
      4. Summary
    3. What's New in SQL Server 2000
      1. New SQL Server 2000 Features
      2. SQL Server 2000 Enhancements
      3. SQL Server and the .NET Framework
      4. Summary
  6. SQL Server Tools and Utilities
    1. SQL Server Enterprise Manager
      1. Establishing Server Groups and Registering SQL Server in Enterprise Manager
      2. Server Configuration
      3. Databases
      4. Security
      5. Server Management
      6. Data Transformation Services
      7. Support Services
      8. System Tools
      9. Replication
      10. Using the Database Taskpad
      11. Using the Query Designer
      12. Scripting Objects
      13. Getting Help
      14. Summary
    2. SQL Server Command-Line Utilities
      1. BCP
      2. Data Transformation Services Utilities
      3. ISQL/OSQL
      4. makepipe and readpipe
      5. ODBCcmpt
      6. odbcping
      7. rebuildm
      8. regrebld
      9. Replication Utilities
      10. SQLDiag
      11. SQLMaint
      12. SQLServr
      13. VSwitch
      14. Summary
    3. SQL Server Query Analyzer and SQL Debugger
      1. Query Analyzer
      2. The SQL Debugger
      3. Summary
    4. Using the SQL Server Profiler
      1. SQL Server Profiler Architecture
      2. Creating Traces
      3. Saving and Exporting Traces
      4. Replaying Trace Data
      5. Defining Server-Side Traces
      6. Profiler Usage Scenarios
      7. Summary
  7. SQL Server Administration
    1. Installing and Upgrading SQL Server
      1. Choosing a SQL Server Edition
      2. Hardware Requirements
      3. Software Requirements
      4. Selecting Installation Configuration Options
      5. Verifying Installation
      6. Starting, Stopping, and Pausing SQL Server
      7. Post-Installation Configuration
      8. Installation Troubleshooting
      9. Remote Installation
      10. Unattended Installation
      11. Installing a Named Instance
      12. Upgrading from Previous Versions
      13. Summary
    2. Client Installation and Configuration
      1. The SQL Server Client Architecture
      2. Installing Client Tools
      3. Client Configuration
      4. Network Protocol Support
      5. Installing ODBC
      6. Microsoft Driver for JDBC
      7. Connecting to SQL Server over the Internet
      8. Summary
    3. SQL Server System and Database Administration
      1. Responsibilities of the System Administrator
      2. System Databases
      3. System Tables
      4. System-Stored Procedures
      5. Useful System Procedures
      6. Other Methods of Querying the System Tables
      7. Summary
    4. Creating and Managing Databases
      1. What Makes Up a SQL Server Database?
      2. Data Storage in SQL Server
      3. Database Files
      4. Creating Databases
      5. Managing Databases
      6. Setting Database Options
      7. Summary
    5. Creating and Managing Tables in SQL Server
      1. Datatypes
      2. Numeric Datatypes
      3. Datatype Synonyms
      4. User-Defined Datatypes
      5. Creating Tables
      6. Creating Tables Using T-SQL
      7. Creating Tables Using Table Designer
      8. Viewing Table Properties and Data in Enterprise Manager
      9. Limitations on Table Size and Dimensions
      10. Dropping Tables
      11. Temporary Tables
      12. Summary
    6. Creating and Managing Indexes
      1. Types of Indexes
      2. Creating Indexes Using T-SQL
      3. Creating Indexes Using Enterprise Manager
      4. Managing Indexes
      5. Dropping Indexes
      6. Summary
    7. Implementing Data Integrity
      1. Types of Data Integrity
      2. Enforcing Data Integrity
      3. Constraints
      4. Rules
      5. Defaults
      6. Summary
    8. Security and User Administration
      1. An Overview of SQL Server Security
      2. Authentication Methods
      3. SQL Server Security: Logins
      4. SQL Server Security: Users
      5. SQL Server Security: Roles
      6. Managing SQL Server Logins
      7. Managing SQL Server Users
      8. Managing Database Roles
      9. Managing SQL Server Permissions
      10. SQL Server Permission Approaches
      11. Object Owners
      12. Using Encryption
      13. Summary
    9. Database Backup and Restore
      1. Developing a Backup and Restore Plan
      2. Why Back Up Your Databases?
      3. A Typical Backup and Restore Scenario
      4. Types of Backups
      5. Setting the Recovery Mode
      6. Backup Devices
      7. Media Sets and Families
      8. Creating Backup Devices with Transact-SQL
      9. Creating Backup Devices with SQL Enterprise Manager
      10. Backing Up the Database
      11. Backing Up the Transaction Log
      12. Restoring the Database
      13. Transact-SQL Restore Examples
      14. Restoring to a Different Database
      15. Restoring a File or Filegroup
      16. Restoring to a Point in Time
      17. Performing a Partial Database Restore
      18. Restoring the System Databases
      19. Additional Backup Considerations
      20. Summary
    10. Database Maintenance
      1. What Needs to Be Maintained
      2. The Database Maintenance Plan Wizard
      3. Setting Up Your Own Maintenance Tasks
      4. The Database Console Commands (DBCC)
      5. Using SQLMAINT.EXE for Database Maintenance
      6. Summary
    11. SQL Server Scheduling and Notification
      1. SQL Agent Overview
      2. Configuring SQL Server Agent
      3. Viewing the SQL Server Agent Error Log
      4. Operators
      5. Jobs
      6. Alerts
      7. Scripting Jobs and Alerts
      8. Multiserver Job Management
      9. Event Forwarding
      10. Summary
    12. Managing Linked and Remote Servers
      1. Remote Servers
      2. Linked Servers
      3. Adding, Dropping, and Configuring Linked Servers
      4. Mapping Local Logins to Logins on Linked Servers
      5. Obtaining General Information About Linked Servers
      6. Executing a Stored Procedure Via a Linked Server
      7. Setting Up Linked Servers Through Enterprise Manager
      8. Summary
    13. Importing and Exporting SQL Server Data Using BCP and DTS
      1. Bulk-Copy Program (BCP)
      2. The Bulk-Copy Program
      3. Logged and Non-Logged Operations
      4. The BULK INSERT Statement (Transact-SQL)
      5. Improving Load Performance
      6. BCP Extras
      7. Data Transformation Services (DTS)
      8. DTS Architecture and Concepts
      9. Package Execution Utilities
      10. Running the DTS Wizard
      11. DTS Designer
      12. A Bit More on Metadata
      13. Summary
    14. Administering Very Large SQL Server Databases
      1. Do I Have a Very Large Database (VLDB)?
      2. VLDB Maintenance Issues
      3. Partitioning Data
      4. Summary
    15. Data Replication
      1. What Is Replication?
      2. The Publisher, Distributor, and Subscriber Metaphor
      3. Replication Scenarios
      4. Replication Agents
      5. Planning for SQL Server Data Replication
      6. SQL Server Replication Types
      7. User Requirements Drive the Replication Design
      8. Setting Up Replication
      9. Scripting Replication
      10. Monitoring Replication
      11. Summary
    16. SQL Mail
      1. Setting Up an E-Mail Client/Profile
      2. Configuring SQL Mail
      3. Configuring SQLAgentMail
      4. SQL Mail Stored Procedures
      5. Summary
    17. SQL Server Clustering
      1. From Windows NT Enterprise Edition to Windows 2000 Advanced Server
      2. Cluster Services
      3. SQL Clustering and Fail-Over Support
      4. Network Load Balancing
      5. Summary
    18. Defining System Administration and Naming Standards
      1. The SQL Server Environment Approach
      2. SQL Server Naming Standards
      3. Summary
  8. Transact-SQL
    1. Using Transact-SQL in SQL Server 2000
      1. T-SQL and ANSI/ISO SQL
      2. What's New for T-SQL in SQL Server 2000
      3. SELECT, INSERT, UPDATE, and DELETE
      4. SQL Server Functions
      5. Programming Constructs
      6. Cursors
      7. Summary
    2. Creating and Managing Views in SQL Server
      1. Definition of Views
      2. Using Views to Simplify Retrieval of Data
      3. Using Views to Hide Underlying Table Structures
      4. Using Views as a Security Mechanism
      5. Data Modifications and Views
      6. Creating Views
      7. Altering and Dropping Views
      8. Partitioned Views
      9. Indexed Views
      10. Views and Query Performance
      11. Summary
    3. Creating and Managing Stored Procedures in SQL Server
      1. Advantages of Stored Procedures
      2. Creating and Executing Stored Procedures
      3. Deferred Name Resolution
      4. Viewing and Modifying Stored Procedures
      5. Using Input Parameters
      6. Using Output Parameters
      7. Returning Procedure Status
      8. Cursors in Stored Procedures
      9. Nested Stored Procedures
      10. Using Temporary Tables in Stored Procedures
      11. Using the table Datatype
      12. Remote Stored Procedures
      13. Debugging Stored Procedures with Query Analyzer
      14. Debugging with Microsoft Visual Studio and Visual Basic
      15. System Stored Procedures
      16. Stored-Procedure Performance
      17. Using Dynamic SQL in Stored Procedures
      18. Autostart Procedures
      19. Extended Stored Procedures
      20. Stored Procedure Coding Guidelines and Limitations
      21. Summary
    4. Creating and Managing Triggers
      1. Benefits and Uses of Triggers
      2. Creating Triggers
      3. AFTER Triggers
      4. inserted and deleted Tables
      5. Checking for Column Updates
      6. Nested Triggers
      7. Recursive Triggers
      8. Enforcing Referential Integrity with Triggers
      9. INSTEAD OF Triggers
      10. Summary
    5. User-Defined Functions
      1. Why Use User-Defined Functions?
      2. Types of Functions
      3. Creating and Managing Functions
      4. System-Wide Table Valued Functions
      5. Rewriting Stored Procedures as Functions
      6. Summary
    6. Transaction Management and the Transaction Log
      1. What Is a Transaction?
      2. How SQL Server Manages Transactions
      3. Defining Transactions
      4. Transaction Logging and the Recovery Process
      5. Transactions and Batches
      6. Transactions and Stored Procedures
      7. Transactions and Triggers
      8. Transactions and Locking
      9. Coding Effective Transactions
      10. Long-Running Transactions
      11. Bound Connections
      12. Distributed Transactions
      13. Summary
    7. Distributed Transaction Processing
      1. Distributed Transaction Processing
      2. Distributed Queries
      3. Linked Servers
      4. Distributed Transactions
      5. MS DTC Architecture
      6. Summary
  9. SQL Server Internals and Performance Tuning
    1. SQL Server Internals
      1. SQL Server Memory Management
      2. SQL Server Process Management
      3. SQL Server Disk I/O
      4. SQL Server Storage Structures
      5. Database Files and Filegroups
      6. Database Pages
      7. Tables
      8. Indexes
      9. Data Modification and Performance
      10. Summary
    2. Indexes and Performance
      1. Index Usage Criteria
      2. Index Selection
      3. Evaluating Index Usefulness
      4. Index Statistics
      5. Index Design Guidelines
      6. Indexed Views
      7. Indexes on Computed Columns
      8. The Index Tuning Wizard
      9. Choosing Indexes: Query Versus Update Performance
      10. Summary
    3. Understanding Query Optimization
      1. What Is a Query Optimizer?
      2. Query Compilation and Optimization
      3. Step 1: Query Analysis
      4. Step 2: Index Selection
      5. Step 3: Join Selection
      6. Step 4: Execution Plan Selection
      7. Reusing Query Plans
      8. Other Query Processing Strategies
      9. Parallel Query Processing
      10. Data Warehousing and Large Database Query Strategies
      11. Common Query Optimization Problems
      12. Managing the Optimizer
      13. Summary
    4. Query Analysis
      1. Displaying Execution Plans in Query Analyzer
      2. Query Analyzer Server Trace
      3. Query Analyzer Client Statistics
      4. SHOWPLAN_ALL and SHOWPLAN_TEXT
      5. Statistics
      6. Query Analysis with SQL Profiler
      7. Summary
    5. Monitoring SQL Server Performance
      1. Performance-Monitoring Approach
      2. Performance Monitor
      3. Windows Performance Counters
      4. SQL Server Performance Counters
      5. SNMP Support
      6. Using DBCC to Examine Performance
      7. Other SQL Server Performance Considerations
      8. Summary
    6. Locking and Performance
      1. The Need for Locking
      2. Transaction Isolation Levels in SQL Server
      3. The Lock Manager
      4. Monitoring Lock Activity in SQL Server
      5. SQL Server Lock Types
      6. SQL Server Lock Granularity
      7. Lock Compatibility
      8. Locking Contention and Deadlocks
      9. Table Hints for Locking
      10. Optimistic Locking
      11. Summary
    7. Database Design and Performance
      1. Basic Tenets of Designing for Performance
      2. Logical Database Design Issues
      3. Denormalizing the Database
      4. Database Filegroups and Performance
      5. RAID Technology
      6. Summary
    8. Configuring, Tuning, and Optimizing SQL Server Options
      1. SQL Server Instance Architecture
      2. Configuration Options
      3. Fixing an Incorrect Option Setting
      4. Setting Configuration Options with SQL Enterprise Manager
      5. Obsolete Configuration Options
      6. Configuration Options and Performance
      7. Summary
  10. Additional SQL Server Features
    1. Using XML in SQL Server 2000
      1. Creating a Virtual Directory for Use with SQL Server 2000
      2. Exploring Extensible Markup Language (XML)
      3. Retrieving Data Using the FOR XML Clause
      4. Using FOR XML RAW
      5. Using FOR XML AUTO
      6. Using FOR XML AUTO, ELEMENTS
      7. Using FOR XML EXPLICIT
      8. Retrieving XML-Data Schemas
      9. Retrieving Binary Data in XML
      10. The Basics of XML Path Language (XPath)
      11. Using XML in Stored Procedures
      12. Using OPENXML to Read XML
      13. Using URL Queries
      14. Using XML Templates
      15. Using XML Updategrams
      16. Summary
    2. Microsoft SQL Server Analysis Services
      1. What Is Analysis Services and OLAP?
      2. Understanding the Analysis Services Environment and the “Land of Wizards”
      3. An Analytics Design Methodology
      4. An Analytics Mini-Methodology
      5. An OLAP Requirements Example
      6. OLAP Cube Creation
      7. Creating an OLAP Database
      8. Working with a Relational Database
      9. Files at the Operating System Level
      10. Summary
    3. Microsoft Transaction Server
      1. MTS Overview
      2. Auilding an MTS Component
      3. Installing an MTS Component
      4. Configuring Security
      5. Running an MTS Application
      6. Using Database Connection Pooling
      7. Summary
    4. SQL Server Full-Text Search Services
      1. How Search Server Works
      2. Setting Up a Full-Text Index
      3. Maintaining Full-Text Indexes
      4. Full-Text Searches
      5. Using Document Filters
      6. Summary
    5. SQL Server Notification Services
      1. Introduction to SQL Notification Services
      2. Obtaining and Installing SQL Notification Services
      3. SQL Notification Services Architecture
      4. Instances and Applications
      5. Deploying and Configuring a Notification Services Instance
      6. Monitoring and Administering a Notification Services Instance
      7. Summary
    6. SQL Server and the Microsoft .NET Framework
      1. The Microsoft .NET Framework Class Library
      2. ADO.NET
      3. .NET SQL Providers
      4. .NET Concurrency Model (Default)
      5. XML Externalization in .NET
      6. A .NET Application Within Visual Studio .NET
      7. Summary
    7. English Query
      1. What Is English Query?
      2. Getting Started with English Query
      3. How Does English Query Work?
      4. Building a Simple English Query Application
      5. Contextual Information
      6. Summary
  11. Index