Book description
Master the increasingly complex feature set of the latest release of Microsoft SQL Server with the information in Professional Microsoft SQL Server 2008 Programming. Review the new features of SQL Server that will be of interest to you as an experienced developer and move on to more detailed, practical code examples. Learn how to write complex queries, build different types of data structures, improve application speed and performance, manage advanced scripting and errors, and design advanced databases the latest edition of this valuable programming guide.
Table of contents
- Copyright
- About the Author
- Credits
- Acknowledgments
- Introduction
-
1. Being Objective: Re-Examining Objects in SQL Server
- 1.1. So, What Exactly Do We Have Here?
-
1.2. An Overview of Database Objects
- 1.2.1. The Database Object
- 1.2.2. The Transaction Log
- 1.2.3. The Most Basic Database Object: Table
- 1.2.4. Schemas
- 1.2.5. Filegroups
- 1.2.6. Diagrams
- 1.2.7. Views
- 1.2.8. Stored Procedures
- 1.2.9. User-Defined Functions
- 1.2.10. Users and Roles
- 1.2.11. Rules
- 1.2.12. Defaults
- 1.2.13. User-Defined Data Types
- 1.2.14. Full-Text Catalogs
- 1.3. SQL Server Data Types
- 1.4. SQL Server Identifiers for Objects
- 1.5. Summary
-
2. Tool Time
- 2.1. Books Online
- 2.2. The SQL Server Configuration Manager
- 2.3. The SQL Server Management Studio
- 2.4. SQL Server Business Intelligence Development Studio
- 2.5. SQL Server Integration Services (SSIS)
- 2.6. Reporting Services
- 2.7. Bulk Copy Program (bcp)
- 2.8. SQL Server Profiler
- 2.9. sqlcmd
- 2.10. Summary
-
3. Asking a Better Question: Advanced Queries
- 3.1. A Quick Review of Subqueries
- 3.2. Building a Nested Subquery
- 3.3. Correlated Subqueries
- 3.4. Derived Tables
- 3.5. The EXISTS Operator
- 3.6. The INTERSECT and EXCEPT Operators
- 3.7. Common Table Expressions (CTEs)
- 3.8. Recursive Queries
- 3.9. MERGE
- 3.10. Using External Calls to Perform Complex Actions
- 3.11. Performance Considerations
- 3.12. Summary
-
4. XML Integration
- 4.1. The XML Data Type
- 4.2. Retrieving Relational Data in XML Format
- 4.3. A Quick Heads Up Regarding XML Indexes
- 4.4. A Brief Word on Hierarchical Data
- 4.5. Summary
-
5. Daring to Design
- 5.1. Normalization 201
- 5.2. Relationships
- 5.3. Diagramming
- 5.4. Logical versus Physical Design
- 5.5. Dealing with File-Based Information Via Classic BLOBs
- 5.6. Subcategories
- 5.7. Database Reuse
- 5.8. De-Normalization
- 5.9. Partitioning for Scalability
- 5.10. The SQL Server Diagramming Tools
- 5.11. Regarding Date Columns
- 5.12. Summary
-
6. Core Storage and Index Structure
- 6.1. SQL Server Storage
- 6.2. Understanding Indexes
- 6.3. Creating, Altering, and Dropping Indexes
- 6.4. Choosing Wisely: Deciding What Index Goes Where and When
- 6.5. Maintaining Your Indexes
- 6.6. Summary
-
7. More Advanced Index Structures
- 7.1. XML Indexes
- 7.2. User-Defined Data Types
- 7.3. Hierarchical Data
- 7.4. Spatial Data
- 7.5. Filestreams
- 7.6. Enabling Filestreaming
- 7.7. Table Compression
- 7.8. Summary
-
8. Views
- 8.1. Reviewing View Syntax
- 8.2. More Complex Views
- 8.3. Editing Views with T-SQL
- 8.4. Dropping Views
- 8.5. Auditing: Displaying Existing Code
- 8.6. Protecting Code: Encrypting Views
- 8.7. About Schema Binding
- 8.8. Making Your View Look Like a Table with VIEW_METADATA
- 8.9. Indexed (Materialized) Views
- 8.10. Partitioned Views
- 8.11. Summary
-
9. Scripts and Batches
- 9.1. Script Basics
- 9.2. Batches
- 9.3. SQLCMD
- 9.4. Dynamic SQL: Generating Your Code on the Fly with the EXEC Command
- 9.5. Control-of-Flow Statements
- 9.6. Summary
-
10. Advanced Programmability
- 10.1. A More Advanced Look At Stored Procedures
- 10.2. Table-Valued Parameters (TVPs)
- 10.3. Debugging
- 10.4. Understanding the SQLCLR and .NET Programming in SQL Server
- 10.5. Creating Aggregate Functions
- 10.6. Custom Data Types
- 10.7. Summary
-
11. Transactions and Locks
- 11.1. Transactions
-
11.2. How the SQL Server Log Works
- 11.2.1. Using the CHECKPOINT Command
- 11.2.2. At Normal Server Shutdown
- 11.2.3. At a Change of Database Options
- 11.2.4. When the Truncate on Checkpoint Option Is Active
- 11.2.5. When Recovery Time Would Exceed the Recovery Interval Option Setting
- 11.2.6. Failure and Recovery
- 11.2.7. Implicit Transactions
- 11.3. Locks and Concurrency
- 11.4. Setting the Isolation Level
- 11.5. Dealing with Deadlocks (a.k.a. "A 1205")
- 11.6. Summary
-
12. Triggers
- 12.1. What Is a Trigger?
- 12.2. Using Triggers for Data Integrity Rules
- 12.3. Other Common Uses for Triggers
- 12.4. Other Trigger Issues
- 12.5. INSTEAD OF Triggers
- 12.6. IF UPDATE() and COLUMNS_UPDATED()
- 12.7. Performance Considerations
- 12.8. Dropping Triggers
- 12.9. Summary
-
13. SQL Cursors
- 13.1. What Is a Cursor?
- 13.2. The Life Span of a Cursor
- 13.3. Types of Cursors and Extended Declaration Syntax
- 13.4. Navigating the Cursor: The FETCH Statement
- 13.5. Altering Data within Your Cursor
- 13.6. Summary
-
14. Reporting Services
- 14.1. A Quick Look at Reports as a Concept
- 14.2. Reporting Services 101
- 14.3. Report Server Projects
- 14.4. A Brief Note on RDL
- 14.5. Summary
- 15. Buying in Bulk: The Bulk Copy Program (BCP) and Other Basic Bulk Operations
- 16. Getting Integrated
-
17. Replication
- 17.1. Replication Basics
- 17.2. Replication Models
- 17.3. Replication Topology
- 17.4. Planning for Replication
- 17.5. Setting Up Replication in Management Studio
- 17.6. Replication Management Objects (RMO)
- 17.7. Summary
-
18. Looking at Things in Full: Full-Text Search
- 18.1. Full-Text Search Architecture
-
18.2. Setting Up Full-Text Indexes and Catalogs
- 18.2.1. Enabling Full-Text for Your Database
- 18.2.2. Creating, Altering, Dropping, and Manipulating a Full-Text Catalog
- 18.2.3. Creating, Altering, Dropping, and Manipulating Full-Text Indexes
- 18.2.4. A Note Regarding the Older Syntax
- 18.3. More on Index Population
- 18.4. Full-Text Query Syntax
- 18.5. Stop Words
- 18.6. Summary
-
19. Feeling Secure
- 19.1. Security Basics
- 19.2. Security Options
- 19.3. User Permissions
- 19.4. Server and Database Roles
- 19.5. Application Roles
- 19.6. More Advanced Security
- 19.7. Certificates and Asymmetric Keys
- 19.8. Summary
-
20. A Grand Performance: Designing a Database That Performs Well
- 20.1. When to Tune
- 20.2. Index Choices
- 20.3. Client vs. Server-Side Processing
- 20.4. Strategic De-Normalization
- 20.5. Organizing Your Sprocs Well
- 20.6. Uses for Temporary Tables
- 20.7. Update Your Code In a Timely Fashion
- 20.8. Sometimes, It's the Little Things
- 20.9. Hardware Considerations
- 20.10. Summary
-
21. What Comes After: Forensic Performance Tuning
- 21.1. When to Tune (Mark Two)
- 21.2. Routine Maintenance
- 21.3. Troubleshooting
- 21.4. Summary
-
22. Administration
- 22.1. Scheduling Jobs
- 22.2. Backup and Recovery
- 22.3. Index Maintenance
- 22.4. Archiving of Data
- 22.5. PowerShell
- 22.6. Policy-Based Management
- 22.7. Summary
- 23. SMO: SQL Management Objects
- 24. Data Warehousing
-
25. Being Well Connected
-
25.1. Access Models Past and Present
- 25.1.1. DB-Lib/VBSQL
- 25.1.2. Open Database Connectivity: ODBC
- 25.1.3. Data Access Objects (DAO)
- 25.1.4. Remote Data Objects (RDO)
- 25.1.5. Java Database Connectivity (JDBC)
- 25.1.6. OLE-DB
- 25.1.7. ActiveX Data Objects (ADO)
- 25.1.8. Multi-Dimensional OLE-DB/ADO (OLE-DB MD/ADO MD)
- 25.1.9. ADO.NET
- 25.1.10. Language Integrated Query (aka LINQ)
- 25.2. Some General Concepts
- 25.3. General Performance Considerations
- 25.4. Getting Ready for the More Individual Examples
- 25.5. Exploring ADO.NET
- 25.6. Language Integrated Query (aka LINQ)
- 25.7. A Quick Discussion of Entity Frameworks
- 25.8. Pros and Cons
- 25.9. Summary
-
25.1. Access Models Past and Present
-
A. System Functions
- A.1. Legacy System Functions (a.k.a. Global Variables)
- A.2. Aggregate Functions
- A.3. Configuration Functions
-
A.4. Cryptographic Functions
- A.4.1. AsymKey_ID
- A.4.2. Cert_ID
- A.4.3. CertProperty
- A.4.4. DecryptByAsmKey
- A.4.5. DecryptByCert
- A.4.6. DecryptByKey
- A.4.7. DecryptByPassPhrase
- A.4.8. EncryptByAsmKey
- A.4.9. EncryptByCert
- A.4.10. EncryptByKey
- A.4.11. EncryptByPassPhrase
- A.4.12. Key_GUID
- A.4.13. Key_ID
- A.4.14. SignByAsymKey
- A.4.15. SignByCert
- A.4.16. VerifySignedByAsymKey
- A.4.17. VerifySignedByCert
- A.5. Cursor Functions
- A.6. Date and Time Functions
- A.7. Mathematical Functions
-
A.8. Basic Metadata Functions
- A.8.1. COL_LENGTH
- A.8.2. COL_NAME
- A.8.3. COLUMNPROPERTY
- A.8.4. DATABASEPROPERTY
- A.8.5. DATABASEPROPERTYEX
- A.8.6. DB_ID
- A.8.7. DB_NAME
- A.8.8. FILE_ID
- A.8.9. FILE_NAME
- A.8.10. FILEGROUP_ID
- A.8.11. FILEGROUP_NAME
- A.8.12. FILEGROUPPROPERTY
- A.8.13. FILEPROPERTY
- A.8.14. FULLTEXTCATALOGPROPERTY
- A.8.15. FULLTEXTSERVICEPROPERTY
- A.8.16. INDEX_COL
- A.8.17. INDEXKEY_PROPERTY
- A.8.18. INDEXPROPERTY
- A.8.19. OBJECT_ID
- A.8.20. OBJECT_NAME
- A.8.21. OBJECTPROPERTY
- A.8.22. OBJECTPROPERTYEX
- A.8.23. @@PROCID
- A.8.24. SCHEMA_ID
- A.8.25. SCHEMA_NAME
- A.8.26. SQL_VARIANT_PROPERTY
- A.8.27. TYPEPROPERTY
- A.9. Rowset Functions
- A.10. Security Functions
-
A.11. String Functions
- A.11.1. ASCII
- A.11.2. CHAR
- A.11.3. CHARINDEX
- A.11.4. DIFFERENCE
- A.11.5. LEFT
- A.11.6. LEN
- A.11.7. LOWER
- A.11.8. LTRIM
- A.11.9. NCHAR
- A.11.10. PATINDEX
- A.11.11. QUOTENAME
- A.11.12. REPLACE
- A.11.13. REPLICATE
- A.11.14. REVERSE
- A.11.15. RIGHT
- A.11.16. RTRIM
- A.11.17. SOUNDEX
- A.11.18. SPACE
- A.11.19. STR
- A.11.20. STUFF
- A.11.21. SUBSTRING
- A.11.22. UNICODE
- A.11.23. UPPER
-
A.12. System Functions
- A.12.1. APP_NAME
- A.12.2. CASE
- A.12.3. CAST and CONVERT
- A.12.4. COALESCE
- A.12.5. COLLATIONPROPERTY
- A.12.6. CURRENT_USER
- A.12.7. DATALENGTH
- A.12.8. @@ERROR
- A.12.9. FORMATMESSAGE
- A.12.10. GETANSINULL
- A.12.11. HOST_ID
- A.12.12. HOST_NAME
- A.12.13. IDENT_CURRENT
- A.12.14. IDENT_INCR
- A.12.15. IDENT_SEED
- A.12.16. @@IDENTITY
- A.12.17. IDENTITY
- A.12.18. ISNULL
- A.12.19. ISNUMERIC
- A.12.20. NEWID
- A.12.21. NULLIF
- A.12.22. PARSENAME
- A.12.23. PERMISSIONS
- A.12.24. @@ROWCOUNT
- A.12.25. ROWCOUNT_BIG
- A.12.26. SCOPE_IDENTITY
- A.12.27. SERVERPROPERTY
- A.12.28. SESSION_USER
- A.12.29. SESSIONPROPERTY
- A.12.30. STATS_DATE
- A.12.31. SYSTEM_USER
- A.12.32. USER_NAME
- A.13. Text and Image Functions
-
B. Going Meta: Getting Data About Your Data
-
B.1. System Views
- B.1.1. sys.assemblies
- B.1.2. sys.columns
- B.1.3. sys.databases
- B.1.4. sys.database_files
- B.1.5. sys.identity_columns
- B.1.6. sys.indexes
- B.1.7. sys.index_columns
- B.1.8. sys.objects
- B.1.9. sys.partitions
- B.1.10. sys.partition_functions
- B.1.11. sys.schemas
- B.1.12. sys.servers
- B.1.13. sys.spatial_indexes
- B.1.14. sys.synonyms
- B.1.15. sys.user_token
- B.1.16. sys.xml_indexes
- B.2. Dynamic Management Views
-
B.1. System Views
- C. The Basics
Product information
- Title: Professional Microsoft® SQL Server® 2008 Programming
- Author(s):
- Release date: April 2009
- Publisher(s): Wrox
- ISBN: 9780470257029
You might also like
book
Level Up! The Guide to Great Video Game Design, 2nd Edition
Want to design your own video games? Let expert Scott Rogers show you how! If you …
book
The Art of Communication
Bring nuance, depth, and meaning to every conversation you have The Art of Communication is for …
audiobook
How to Do Nothing
A galvanizing critique of the forces vying for our attention-and our personal information-that redefines what we …
audiobook
Fall in Love with the Problem, Not the Solution
Unicorns-companies that reach a valuation of more than $1 billion-are rare. Uri Levine has built two. …