Pro T-SQL 2008 Programmer’s Guide
by Michael Coles
Link to Amazon
Pro T-SQL 2008 Programmer’s Guide examines SQL Server 2008 T-SQL from a developer’s perspective. This information-rich book covers a wide array of developer-specific topics in SQL Server 2008. In addition, it provides in-depth knowledge of various newly introduced topics. This book is written as a practical guide to help database developers who mainly deal with T-SQL. It has really hit the spot with appropriate .NET code at a few places where required. The book assumes a basic knowledge of SQL, but it is very easy to understand for novice developers, while for advanced developers it is a great source to enhance their knowledge.
Pro T-SQL 2008 Programmer’s Guide is a well-written and well-structured book with a good depth and breadth of quality content presented in a reader friendly way. The book is structured into chapters where latest and comprehensive information have been backed with numerous examples to facilitate understanding of all levels of developers. What I really liked about this book is that it can either be read from cover to cover, or can be used as a reference guide for finding information topic-wise. A well-organized index aids in finding the topics very quickly.
Apart from valuable knowledge, each chapter of the book contains excellent advice and is filled with sample code (available online). It primarily revolves around SQL Server 2008 and innovative ways to code T-SQL, new functions and commands. It addresses many details and comparisons with T-SQL in a very organized manner. All the examples have been carefully selected and are accurate, useful and sufficient for the targeted topics. In addition, this book addresses a number of real-world issues with examples, discussions and solutions.
SQLCMD and SQL Server Management Studio are advanced tools to explore SQL Server 2008 that have been covered in depth in the beginning of the book. I would like to discuss Chapter 2 in detail. This chapter dives right into the new features of T-SQL on SQL Server 2008, with discussion on productivity-enhancing features, the new MERGE statement, new data types like geometry and hierarchyid, and grouping sets. Chapter 13 introduces SQL Server 2008 catalog views, which are the preferred tools for retrieving database and database object metadata. This chapter also hashes out dynamic management views and functions, which provide access to server and database state information.
Chapters that cover Common Table Expressions (CTEs), new data types, operators, keywords, functions, and control of flows are very interesting and contain necessary explanation. Readers of my blog are very well aware of my interests in Error handling and Debugging. Interesting enough for me, there is one whole chapter dedicated to these areas. Some of the regular T-SQL concepts such as Stored Procedure, Triggers and Dynamic SQL, which I write a lot about, have also been covered in this book and each have a chapter dedicated to them. The last three chapters of the book on SQLCLR, .NET Client Programming and HTTP Endpoints necessitate Microsoft .NET FrameWork 2.0, as they contain some codes that are written in VB and C#.
One demerit with other run-of-the-mill T-SQL books is that they do not include in-depth information on XML, XQuery and XPath, while these topic have been discussed in good detail in this book, and their importance has been appropriately explained. Yet another attractive feature of this book is that all the chapters contain exercise with Appendix A having answers to all the questions asked. Appendix D comprises quick reference to SQLCMD command-line tool, which I have been using myself.
Some excerpts from the book that demonstrate how complex subjects have been explained in a lucid way and present the visionary attitude of the author.
“How do you pass parameters to triggers? The short answer is you can’t. Because they are automatically fired in response to events, SQL Server triggers provide no means to pass in parameters.”
“When used with an aggregate function like SUM, COUNT, or AVG, or a user-defined aggregate, the OVER clause can only take a PARTITION BY clause-not an ORDER BY clause. This is a serious shortcoming in the SQL Server implementation of OVER for aggregate functions. ORDER BY in the OVER clause for aggregate functions allows you to easily perform single-statement running sum-type calculations. Running sum calculations without this feature require extensive joins, causing many people to fall back on cursors. ORDER BY for the aggregate OVER clause, and other features related to windowing functions, has been submitted as a feature request to Microsoft. Hopefully, we’ll see it implemented at some point in the near future.”
One thing that I have always liked in any database book is the use of sample database AdventureWorks. I strongly believe that the all the examples should be independent of the previous examples and should use default database. If you have not installed default database AdventureWorks, you can get its latest location by searching in my blog SQLAuthority.com. All the scripts of examples are easily available and can be downloaded online. No book is free from errors and the website for this book has errata list, which is surprisingly very small.
Rating: 5 Stars
To sum up, Pro T-SQL 2008 Programmer’s Guide is a must-read book for every developer who wants to take full advantage of the power of T-SQL on SQL Server 2008. This book by Author Michel Coles it meant to facilitate developers – they can now spend less time worrying about how things get done and instead think about what they actually want to get done.
Reference : Pinal Dave (https://blog.sqlauthority.com)