0%

Book Description

Sams Teach Yourself Transact-SQL in 21 Days, 2E will teach programmers how to develop Transact-SQL queries. There will be a focus on providing methods for improving productivity without a reducing performance. Specifically, the reader will:Learn Transact-SQL syntax Learn how to add, delete, and modifying data using Transact-SQL Understand coding standards Review variations from ANSI-standard SQL Be presented with basic server operations. Recognize performance issues with queries. This book will also include:Constructs such as CUBE, ROLLUP, CASE, and JOIN. Techniques to solve complex problems How the server uses indexes Methods to write (correctly) stored procedures and triggers. Templates of procedures and triggers (reference) Advanced Topics such as: Outer and self joins Temporary tables Sub-queries.

Table of Contents

  1. Copyright
  2. About the Authors
  3. Tell Us What You Think!
  4. Introduction
  5. Working with Rows and Columns
    1. Introduction to SQL and the Query Analyzer
      1. SQL and SQL Server
      2. What Is T-SQL?
      3. Retrieving Data with Query Analyzer
      4. Introducing SQL Server 2000 Enterprise Manager
      5. Summary
      6. Q&A
      7. Workshop
    2. Filtering and Sorting Data
      1. Filtering Data with WHERE Clauses
      2. Combining Conditions with OR and AND
      3. Searching for Ranges of Values with Inequalities (>, <, BETWEEN)
      4. Getting Correct Results from Date Comparisons
      5. Looking for Values in a List: The IN Operator
      6. Wildcard Searches with LIKE
      7. Summary of Search Conditions
      8. Sorting Data (ORDER BY)
      9. Retrieving Unique Rows
      10. Summary
      11. Q&A
      12. Workshop
    3. Working with Columns
      1. Column Characteristics
      2. Changing Result Sets
      3. Summary
      4. Q&A
      5. Workshop
    4. Working with Row Aggregates and Grouping
      1. Working with Aggregate Functions
      2. Grouping Data
      3. Creating Pivot Tables
      4. Summary
      5. Q&A
      6. Workshop
    5. Joining Tables
      1. Understanding Joins
      2. Understanding More About Joins
      3. Writing Outer Joins
      4. Joining a Table to Itself
      5. Using Union to Merge Result Sets
      6. Summary
      7. Q&A
      8. Workshop
    6. Using Subqueries
      1. Understanding Subqueries
      2. Matching a Value with Subqueries
      3. Checking for Membership
      4. Summary
      5. Q&A
      6. Workshop
    7. Adding, Changing, and Deleting Rows
      1. Creating Tables
      2. Deleting Tables
      3. Inserting Rows
      4. Updating Rows
      5. Deleting Rows
      6. Summary
      7. Q&A
      8. Workshop
  6. Programming with T-SQL
    1. Defining Data
      1. What Is Data Definition Language (DDL)?
      2. Working with Tables
      3. Altering Tables
      4. Defining Constraints
      5. Defining Table Relationships
      6. Summary
      7. Q&A
      8. Workshop
    2. Indexes and Performance
      1. How SQL Server Uses Indexes
      2. Defining and Managing Indexes
      3. Performing Index Maintenance and Using Performance Tools
      4. Summary
      5. Q&A
      6. Workshop
    3. Views and Temporary Tables
      1. Using Views to Access Data
      2. Using Temporary Tables for Storing Data
      3. Temporary Tables Versus Views
      4. Summary
      5. Q&A
      6. Workshop
    4. T-SQL Programming Fundamentals
      1. Handling Variables
      2. Reviewing Programming Structures
      3. Trapping Errors and Implementing Error Handling
      4. Summary
      5. Q&A
      6. Workshop
    5. Understanding Database Locking
      1. Lock Fundamentals
      2. Testing Lock Interaction
      3. Understanding Lock Persistence
      4. Summary
      5. Q&A
      6. Workshop
    6. Programming with Transactions
      1. Understanding Transaction Basics
      2. Controlling Transactions in Your Programs
      3. Managing Concurrency
      4. Handling Long-Running Transactions
      5. Summary
      6. Q&A
      7. Workshop
    7. Using Cursors
      1. Defining Cursors
      2. Working with Cursors
      3. Cursor Locking
      4. Summary
      5. Q&A
      6. Workshop
  7. Procedures and Triggers
    1. Day Writing and Executing Stored Procedures
      1. Benefits of Stored Procedures
      2. Writing Your First Stored Procedure
      3. Working with Parameters
      4. Returning Procedure Status
      5. Using Output Parameters
      6. Five Ways to Communicate Between Stored Procedures and Client Programs
      7. Summary
      8. Q&A
      9. Workshop
    2. Optimizing Stored Procedures
      1. Understanding Stored Procedure Optimization
      2. Using Table Variables and Temporary Tables with Procedures
      3. Handling Transactions in Stored Procedures
      4. Summary
      5. Q&A
      6. Workshop
    3. Debugging Stored Procedures
      1. Debugging Explained
      2. Using the T-SQL Debugger
      3. Summary
      4. Q&A
      5. Workshop
    4. Writing and Testing Triggers
      1. Understanding Triggers
      2. Executing Triggers
      3. Using Trigger Resources
      4. Determining When to Use Triggers
      5. Summary
      6. Q&A
      7. Workshop
    5. Solving Special Trigger Problems
      1. Managing Referential Integrity with Triggers
      2. Managing Special Database Actions with Triggers
      3. Summary
      4. Q&A
      5. Workshop
    6. User-Defined Functions in SQL
      1. Understanding User-Defined Functions
      2. Reviewing Advanced UDF Topics
      3. Summary
      4. Q&A
      5. Workshop
    7. Handling BLOBs in T-SQL
      1. Understanding Large Data Types
      2. Managing BLOB Data
      3. Summary
      4. Q&A
      5. Workshop
    8. Answers to Quizzes and Exercises
      1. Day 1
      2. Day 2
      3. Day 3
      4. Day 4
      5. Day 5
      6. Day 6
      7. Day 7
      8. Day 8
      9. Day 9
      10. Day 10
      11. Day 11
      12. Day 12
      13. Day 13
      14. Day 14
      15. Day 15
      16. Day 16
      17. Day 17
      18. Day 18
      19. Day 19
      20. Day 20
      21. Day 21
  8. Index