Get a detailed look at the internal architecture of T-SQL with this comprehensive programming reference. Database developers and administrators get best practices, expert techniques, and code samples to master the intricacies of this programming language—solving complex problems with real-world solutions.
Discover how to:
- Work with T-SQL and CLR user-defined functions, stored procedures, and triggers.
- Handle transactions, concurrency, and error handling.
- Efficiently use temporary objects, including temporary tables, table variables, and table expressions.
- Evaluate when to use set-based programming techniques and when to use cursors.
- Work with dynamic SQL in an efficient and secure manner.
- Treat date- and time-related data in a robust manner.
- Develop CLR user-defined types and learn about temporal support in the relational model.
- Use XML and XQuery and implement a dynamic schema solution.
- Work with spatial data using the new geometry and geography types and spatial indexes.
- Track access and changes to data using extended events, SQL Server Audit, change tracking, and change data capture.
- Use Service Broker for controlled asynchronous processing in database applications.
All the book’s code samples will be available for download from the companion Web site.
About the Author
Dejan Sarka is MCT and MCDBA certified and a Microsoft MVP for SQL Server. He teaches and consults for Solid Quality Mentors, speaks at TechEd and PASS, and develops OLTP, OLAP, and data mining solutions.
Table of Contents
- Chapter 1: Views
- Chapter 2: User-Defined Functions
- Chapter 3: Stored Procedures
- Chapter 4: Triggers
- Chapter 5: Transactions and Concurrency
- Chapter 6: Error Handling
- Chapter 7: Temporary Tables and Table Variables
- Chapter 8: Cursors
- Chapter 9: Dynamic SQL
- Chapter 10: Working with Date and Time
- Chapter 11: CLR User-Defined Types
- Chapter 12: Temporal Support in the Relational Model
- Chapter 13: XML and XQuery
- Chapter 14: Spatial Data
- Chapter 15: Tracking Access and Changes to Data
- Chapter 16: Service Broker
- Companion to CLR Routines
- About the Authors
Most Helpful Customer Reviews
I have used SQL Server since the 6.5/7.0 days and thought I knew enough to get by. I had various experiences with SQL Server 2000/2005, and then did not immediately use SQL Server 2008 until the Spring of 2010; I took a T-SQL CLASS using SQL Server 2008 at Mt. San Antonio College in Walnut, California. I learned a great deal that I did not previously know from Professor Shui-lien Huang, a very excellent teacher. You can work with SQL Server, and unless you have the opportunity to have many challenges to stretch your skills, you may seemingly work in a silo and never learn all of it, which is a good reason to buy this book: "Inside Microsoft SQL Server 2008: T-SQL Programming". I am glad I had the T-SQL class before reading this book. This book contains the typical coverage for a standard T-SQL statement, and then User-Defined Functions (UDFs), Triggers, Stored Procedures, Views, etc., but also some new things. For example, extending SQL Server by using CLR (Common Language Runtime) user defined types, the use of XML, dynamic SQL, and Service Broker for reliable, asynchronous processing, and Spatial Data (i.e. geodata). On the subject of Spatial Data in Chapter 14, Microsoft has brought forth new data types, operators, and indexes to the database. Microsoft introduces the core spatial concepts and provides key programming constructs to successfully navigate this new feature in SQL Server 2008. There are 70 pages covering Spatial Data. Obviously, this is a heavy topic. Because of auditing and compliance requirements, the issue of tracking access and changes to data has become much more important. This book shows how previous versions of SQL Server did take care of this to some degree, but in SQL Server 2008, Microsoft has added the following: change tracking, change data capture, Extended Events, and SQL Server Audit. The book shows provides guidance on where each of these new technologies is best used, and then goes on to show how to implement each technology. This is not a beginner's T-SQL book, but it does cover beginner topics, as mentioned above. In addition, it covers some of the new aspects of SL Server 2008 that are more complex. This is most assuredly a valuable reference book that all T-SQL and .NET developers and database administrators should have nearby. It will give you excellent instruction and answers to your T-SQL questions.