Pro T-SQL 2005 Programmer’s Guide (Paperback)
by Michael Coles (Author)
Link to Amazon
Pro T-SQL 2005 Programmer’s Guide book examines SQL Server 2005 T-SQL from a developer’s perspective. It covers a wide range of developer-specific topics in SQL Server 2005. This book covers many newly introduced topics in depth. This book is written as a practical and useful guide to help database developers who mainly deal with T-SQL. This book has really hit the spot with appropriate .NET code at a few places where needed. This book assumes a basic knowledge of SQL but it is really easy for new beginner developers to understand and advanced developers to enjoy further reading.
One thing I really liked about this book is that it can be either read cover to cover, or it can be used as a reference guide for one particular topic. The index of this book is extremely well organized and aids to find the right topic very quickly. Books is structure is many chapters and each chapter justifies the chapters with good details and proper amount of examples.
Each chapter has excellent advice and knowledge and filled with sample code (available online). The book is targeted specifically at SQL Server 2005 and the innovative ways to code T-SQL, new functions and commands. It is very easy to get started with this book and it immerses in comprehensive reading in no time. This book addresses many details and comparisons with T-SQL in a very organized way. The examples are in very accurate and useful as well sufficient to targeted topics. This book addresses many of the real world issues with examples, discussions and solutions.
This book starts with providing a brief history of T-SQL and the ANSI SQL standards. SQLCMD and SQL Server Management Studio are new tools to explore SQL Server 2005 and are covered in depth in the beginning of the book. Chapters which cover Common Table Expressions (CTEs), new datatypes, operators, keywords, functions, and control of flows are really interesting and with 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 that. The regular T-SQL concepts which I write a lot about Stored Procedure, Triggers and Dynamic SQL each have their own chapter. One thing many T-SQL book does not cover in depth is XML, XQuery and XPath, which are properly discussed and their importance is explained properly. Last three chapters of the book which covers SQLCLR, .NET Client Programming and HTTP Endpoints requires the Microsoft .NET FrameWork 2.0, as it contains some code which are written in VB and C#.
One thing which I always liked in any database book is, use of sample database AdventureWorks. I strongly believe that all the example should be independent from 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 script of examples are available to download online. No book is free from the errors and website for this book has errata list, which is surprisingly very small.
I will list a few tips from the book which interested me. This will give brief idea how good this book is.
“TABLESAMPLE always returns an approximate number of rows because of the way it samples data. The required percentage is the number of data pages SQL Server retrieves in full to fulfill your TABLESAMPLE request. The number of rows returned by TABLESAMPLE will often be slightly less, or greater, than the specified amount.”
“Anytime you use dynamic SQL, make sure that you take precautions against SQL injection, that is, malicious SQL Code being inserted into your SQL statements. In this instance we’re using the QUOTENAME function to quote the column names being dynamically generated to help avoid SQL injection problems.”
Following one example really caught my eyes while reading the book. It seems Author accurately described the situation and put his suggestion regarding syntax.
“The ANSI SQL:2003 standard includes a MERGE statement that performs the same function as the upset type of SP. The prerelease versions of SQL Server 2005 included the MERGE statement. Though it was well-publicized during the prerelease period, the MERGE statement was unceremoniously dropped from the production version. We can only hope that Microsoft will bring it back sometime in the near future.”
The good news is Microsoft have included the Authors’ request in a future version of SQL Server. SQL Server 2008 CTP 4 has included MERGE Keyword.
Rating: 4 and 1/2 stars
In Summary, A book for every developer who want to take full advantage of the power of T-SQL on SQL Server 2005.
Reference : Pinal Dave (http://blog.SQLAuthority.com)