SQL Server 2012 T-SQL Recipes [electronic resource] : A Problem-Solution Approach /
Brimhall, Jason.author.
Dye, David.author.
Roberts, Timothy.author.
Sheffield, Wayne.author.
Gennick, Jonathan.author.
Sack, Joseph.author.
SQL Server 2012 T-SQL Recipes is an example-based guide to the Transact-SQL language that is at the core of SQL Server 2012. It provides ready-to-implement solutions to common programming and database administration tasks. Learn to create databases, insert and update data, generate reports, secure your data, and more. Tasks and their solutions are broken down into a problem/solution format that is quick and easy to read so that you can get the job done fast when the pressure is on. Solutions in this book are divided into chapters by problem domain. Each chapter is a collection of solutions around a single facet of the language such as writing queries, developing triggers, and applying aggregate functions. Each solution is presented code-first, giving you a working code example to copy from and implement immediately in your own environment. Following each example is an in-depth description of how and why the given solution works. Tradeoffs and alternative approaches are also discussed. Focused on solutions: Look up what you need to do. Learn how to do it. Do it. Current: Newly updated for SQL Server 2012 Comprehensive: Covers all common T-SQL problem domains.
Title Page; Copyright Page; Contents at a Glance; Table of Contents; About the Authors; About the Technical Reviewers; Acknowledgments; Introduction; Who This Book Is For; Conventions; Downloading the Code; CHAPTER 1 Getting Started with SELECT; 1-1. Connecting to a Database; Problem; Solution; How It Works; 1-2. Retrieving Speci fi c Columns; Problem; Solution; How It Works; 1-3. Retrieving All Columns; Problem; Solution; How It Works; 1-4. Specifying the Rows to Be Returned; Problem; Solution; How It Works; 1-5. Renaming the Output Columns; Problem; Solution; How It Works
1-6. Building a Column from an ExpressionProblem; Solution; How It Works; 1-7. Providing Shorthand Names for Tables; Problem; Solution; How It Works; 1-8. Negating a Search Condition; Problem; Solution; How It Works; 1-9. Specifying A Range of Values; Problem; Solution; How It Works; 1-10. Checking for NULL Values; Problem; Solution; How It Works; 1-11. Providing a List of Values; Problem; Solution; How It Works; 1-12. Performing Wildcard Searches; Problem; Solution; How It Works; 1-13. Sorting Your Results; Problem; Solution; How It Works; 1-14. Specifying Sort Order; Problem; Solution
How It Works1-15. Sorting by Columns Not Selected; Problem; Solution; How It Works; 1-16. Forcing Unusual Sort Orders; Problem; Solution; How It Works; 1-17. Paging Through A Result Set; Problem; Solution; How It Works; CHAPTER 2 Elementary Programming; 2-1. Declaring Variables; Problem; Solution; How It Works; 2-2. Retrieving a Value into a Variable; Problem; Solution; How It Works; 2-3. Writing an IF...THEN...ELSE Statement; Problem; Solution; How It Works; 2-4. Writing a Simple CASE Expression; Problem; Solution; How It Works; 2-5. Writing a Searched CASE Expression; Problem; Solution
How It Works2-6. Writing a WHILE Statement; Problem; Solution; How It Works; 2-7. Returning from the Current Execution Scope; Problem; Solution #1: Exit with No Return Value; Solution #2: Exit and Provide a Value; How It Works; 2-8. Going to a Label in a Transact-SQL Batch; Problem; Solution; How It Works; 2-9. Pausing Execution for a Period of Time; Problem; Solution; How It Works; 2-10. Creating and Using Cursors; Problem; Solution; How It Works; CHAPTER 3 NULLs and Other Pitfalls; 3-1. Replacing NULL with an Alternate Value; Problem; Solution; How It Works
3-2. Returning the First Non-NULL Value from a ListProblem; Solution; How It Works; 3-3. Choosing Between ISNULL and COALESCE in a SELECT Statement; Problem; Solution; How It Works; 3-4. Looking for NULLs in a Table; Problem; Solution; How It Works; 3-5. Removing Values from an Aggregate; Problem; Solution; How It Works; 3-6. Enforcing Uniqueness with NULL Values; Problem; Solution; How It Works; 3-7. Enforcing Referential Integrity on Nullable Columns; Problem; Solution; How It Works; 3-8. Joining Tables on Nullable Columns; Problem; Solution; How It Works
CHAPTER 4 Querying from Multiple Tables
Includes index.
SQL Server 2012 T-SQL Recipes is an example-based guide to the Transact-SQL language that is at the core of SQL Server 2012. It provides ready-to-implement solutions to common programming and database administration tasks. Learn to create databases, insert and update data, generate reports, secure your data, and more. Tasks and their solutions are broken down into a problem/solution format that is quick and easy to read so that you can get the job done fast when the pressure is on. Solutions in this book are divided into chapters by problem domain. Each chapter is a collection of solutions around a single facet of the language such as writing queries, developing triggers, and applying aggregate functions. Each solution is presented code-first, giving you a working code example to copy from and implement immediately in your own environment. Following each example is an in-depth description of how and why the given solution works. Tradeoffs and alternative approaches are also discussed. Focused on solutions: Look up what you need to do. Learn how to do it. Do it. Current: Newly updated for SQL Server 2012 Comprehensive: Covers all common T-SQL problem domains.
SQL server.
Database management.
Database Management.