Pro T-SQL 2012 Programmer's Guide [electronic resource] /
Coles, Michael.author.
Shaw, Scott.author.
Natarajan, Jay.author.
Bruchez, Rudi.author.
Pro T-SQL 2012 Programmer's Guide is every developer's key to making full use of SQL Server 2012's powerful, built-in Transact-SQL language. Discussing new and existing features, the book takes you on an expert guided tour of Transact-SQL functionality. Fully functioning examples and downloadable source code bring technically accurate and engaging treatment of Transact-SQL into your own hands. Step-by-step explanations ensure clarity, and an advocacy of best-practices will steer you down the road to success. Transact-SQL is the language developers and DBAs use to interact with SQL Server. It's used for everything from querying data, to writing stored procedures, to managing the database. New features in T-SQL 2012 include full support for window functions, stored sequences, the ability to throw errors, data paging, and more. All these important new features are covered in this book. Developers and DBAs alike can benefit from the expressive power of Transact-SQL, and Pro T-SQL 2012 Programmer's Guide provides the gateway to success in applying this increasingly important database language to everyday business and technical tasks.
Title Page; Copyright Page; Contents at a Glance; Table of Contents; About the Authors; About the Technical Reviewer; Acknowledgments; Introduction; Whom This Book Is For; How This Book Is Structured; Conventions; Prerequisites; Apress Website; CHAPTER 1 Foundations of T-SQL; A Short History of T-SQL; Imperative vs. Declarative Languages; SQL Basics; Statements; Databases; Transaction Logs; Schemas; Tables; Views; Indexes; Stored Procedures; User-Defined Functions; SQL CLR Assemblies; Elements of Style; Whitespace; Naming Conventions; One Entry, One Exit; Defensive Coding
The SELECT * StatementVariable Initialization; Summary; CHAPTER 2 Tools of the Trade; SQL Server Management Studio; IntelliSense; Code Snippets; Keyboard Shortcut Schemes; T-SQL Debugging; SSMS Editing Options; Context-Sensitive Help; Graphical Query Execution Plans; Project Management Features; The Object Explorer; The SQLCMD Utility; SQL Server Data Tools; SQL Profiler; Extended Events; SQL Server Integration Services; The Bulk Copy Program; SQL Server 2012 Books Online; The AdventureWorks Sample Database; Summary; CHAPTER 3 Procedural Code and CASE Expressions; Three-Valued Logic
Control-of-Flow StatementsThe BEGIN and END Keywords; The IF. . .ELSE Statement; The WHILE, BREAK, and CONTINUE Statements; The GOTO Statement; The WAITFOR Statement; The RETURN Statement; The CASE Expression; The Simple CASE Expression; The Searched CASE Expression; CASE and Pivot Tables; The IIF Statement; CHOOSE; COALESCE and NULLIF; Cursors; Summary; CHAPTER 4 User-Defined Functions; Scalar Functions; Recursion in Scalar User-Defined Functions; Procedural Code in User-Defined Functions; Multistatement Table-Valued Functions; Inline Table-Valued Functions
Restrictions on User-Defined FunctionsNondeterministic Functions; State of the Database; Summary; CHAPTER 5 Stored Procedures; Introducing Stored Procedures; Metadata Discovery; Calling Stored Procedures; Managing Stored Procedures; Stored Procedures Best Practices; Stored Procedure Example; Recursion in Stored Procedures; Table-Valued Parameters; Temporary Stored Procedures; Recompilation and Caching; Stored Procedure Statistics; Parameter Sniffing; Recompilation; Summary; CHAPTER 6 Triggers; DML Triggers; When to Use DML Triggers; Auditing with DML Triggers; Nested and Recursive Triggers
The UPDATE() and COLUMNS_UPDATED() FunctionsTriggers on Views; DDL Triggers; Logon Triggers; Summary; CHAPTER 7 Encryption; The Encryption Hierarchy; Service Master Keys; Database Master Keys; Certificates; Asymmetric Keys; Symmetric Keys; Encryption without Keys; Hashing Data; Extensible Key Management; Transparent Data Encryption; Summary; CHAPTER 8 Common Table Expressions and Windowing Functions; Common Table Expressions; Multiple Common Table Expressions; Recursive Common Table Expressions; Window Functions; ROW_NUMBER Function; Query Paging with OFFSET/FETCH
The RANK and DENSE_RANK Functions
Includes index.
Pro T-SQL 2012 Programmer's Guide is every developer's key to making full use of SQL Server 2012's powerful, built-in Transact-SQL language. Discussing new and existing features, the book takes you on an expert guided tour of Transact-SQL functionality. Fully functioning examples and downloadable source code bring technically accurate and engaging treatment of Transact-SQL into your own hands. Step-by-step explanations ensure clarity, and an advocacy of best-practices will steer you down the road to success. Transact-SQL is the language developers and DBAs use to interact with SQL Server. It's used for everything from querying data, to writing stored procedures, to managing the database. New features in T-SQL 2012 include full support for window functions, stored sequences, the ability to throw errors, data paging, and more. All these important new features are covered in this book. Developers and DBAs alike can benefit from the expressive power of Transact-SQL, and Pro T-SQL 2012 Programmer's Guide provides the gateway to success in applying this increasingly important database language to everyday business and technical tasks.
Database management.
Database Management.