Preface to Microsoft SQL Server 2014 Unleashed
Introduction
Throughout its lifetime, SQL Server has continued to establish itself as a robust and reliable database platform with performance, scalability, and reliability that meets the implementation needs of businesses and corporations from small desktop applications on up to multi-terabyte enterprise-wide systems. The updates and enhancements in SQL Server 2014 further solidify its position in the marketplace as a robust, high performing, enterprise system providing a database engine foundation that can be available 7 days a week, 365 days a year.
One of the challenges we face writing the SQL Server Unleashed series of books is how to provide comprehensive, in-depth coverage of all of the SQL Server features within a single book. Over the past few releases, the number of SQL Server features and components has increased, and many of these (for example, SQL Server Integration Services, Reporting Services, SQL Server Analysis Services, and .NET Framework integration) are complex enough to warrant separate titles of their own. To cover each topic sufficiently would require more information than could reasonably fit in print in a single volume. So, we had to make some hard decisions as to what topics to include in this edition.
We decided that this edition of the SQL Server Unleashed series would focus on the core database server features and the day-to-day administrative and management aspects and tools of SQL Server 2014, with a focus on SQL Server administration rather than SQL Server development. This way, we can provide sufficient in-depth information, tips, and guidelines to help get you started installing, monitoring, and maintaining your SQL Server 2014 environements. Another primary goal in writing this book was for it to be more than just a syntax reference. SQL Server Books Online is a fine resource as a syntax reference, however it often lacks sufficient examples of how to use the features and commands in SQL Server. This book attempts to pick up where Books Online leaves off, by providing, in addition to syntax where necessary, valuable insight, tips, guidelines, and useful examples derived from our many years of experience working with SQL Server. Although this book does provide the core, and sometimes advanced, syntax elements for the SQL commands discussed, SQL Server Books Online provides a much more extensive syntax reference than would make sense to try to duplicate here. As a matter of fact, at times, we may even direct you to Books Online for more detail on some of the more esoteric syntax options available for certain commands.
We hope that we have succeeded in meeting the goals we set out for this book and that it becomes an essential reference and source of expert information for you as you work with SQL Server 2014.
Who This Book Is For
This Unleashed book is intended for intermediate-level to advanced-level users: SQL Server administrators who want to effectively manage and administer their SQL Server environments and developers who want a more thorough understanding of inner workings SQL Server to help them write better Transact-SQL (T-SQL) code and develop more robust SQL Server applications. If you are responsible for analysis, design, implementation, support, administration, or troubleshooting of SQL Server 2014, this book provides an excellent source of experiential information for you. You can think of this as a book of applied technology. The emphasis is on the more complex aspects of the product, including using the new tools and features, administering SQL Server, analyzing and optimizing queries, implementing data warehouses, ensuring high availability, and tuning SQL Server performance.
This book is primarily intended SQL Server administrators who are new to SQL Server 2014 as well as those who are already familiar with prior versions of SQL Server. Each chapter provides a brief summary of the major changes or new features or capabilities of SQL Server related to that topic. If you are already familiar with SQL Server, you can refer to this summary to focus on the content that covers the new features and capabilities in more detail.
This book is intended to provide a behind-the-scenes look into SQL Server, showing you what goes on beneath the various wizards and GUI-based tools so that you can learn the underlying SQL commands. Although the GUI tools can make your average day-to-day operations much simpler, every database administrator should learn the underlying commands to fully unlock the power and capabilities of SQL Server.
What This Book Covers
The book is divided into the following parts:
• Part I, “Welcome to Microsoft SQL Server”—Chapters in this part introduce you to the Microsoft SQL Server 2014 environment, the various editions of SQL Server that are available, and the capabilities of each edition in the various Windows environments. In addition, it provides an overview of and introduction to the new features found in SQL Server 2014, which are covered in more detail throughout the rest of the book.
• Part II, “SQL Server Tools and Utilities”—Chapters in this part cover the tools and utility programs that SQL Server 2014 provides for you to administer and manage your SQL Server environments. You’ll find information on the various management tools you use on a daily basis, such as SQL Server Management Studio and the SQLCMD command-line query tool, along with information on SQL Server Profiler. If you are not familiar with these tools, you should read this part of the book early on because these tools are often used and referenced throughout many of the other chapters in the book.
• Part III, “SQL Server Administration”—Chapters in this part discuss topics related to the administration of SQL Server at the database server level. It begins with an overview of what is involved in administering a SQL Server environment and then goes on to cover the tasks related to setting up and managing it, including installing and upgrading to SQL Server 2014 as well as installing SQL Server clients. These chapters also include coverage of database backup and restore, using the Database Mail facility, scheduling and notification using SQL Server Agent, implementing Policy-Based Management, and working with and deploying SQL Azure databases.
• Part IV, “Database Administration”—Chapters in this part delve into the administrative tasks associated with creating and managing a SQL Server 2014 database, including the creation and management of database objects such as tables, indexes, views, stored procedures, functions, and triggers. It also covers database snapshots and database maintenance tasks and responsibilities.
• Part V, “SQL Server Performance and Optimization”—Chapters in this part provide information to help you get the best performance out of SQL Server. It begins with a discussion of data structures and indexes—key items to understand to help ensure good database performance. It then builds on that information with chapters on query optimization and analysis, locking, database design and performance, and ways to manage workloads using the Resource Governor.
• Part VI, “SQL Server High Availability”—Chapters in this part cover topics related to achieving high availability for your SQL Server instances, including SQL Server high-availability fundamentals and best practices, as well as chapters on SQL Server replication, SQL Server failover clustering, and SQL Server 2014’s Always On and Availability Groups features.
• Part VII, “SQL Server Business Intelligence Features”—Chapters in this part provide a comprehensive overview of SQL Server 2014’s built-in business intelligence features: Analysis Services, Integration Services, and Reporting Services, enhancements to Master Data Services as well as an introduction to Data Quality Services and the Parallel Data Warehouse Appliance.
• Book Materials on the Web—Many of the code samples, scripts, sample databases and other materials that supplement various chapters of this book are available for download on the Web. Also available for registered owners of the print version of this book are 17 additional chapters that are not included in the print version of the book. Please visit the web page periodically for any updated or additional code samples and bonus material as it becomes available.
Conventions Used in This Book
Names of commands and stored procedures are presented in a special monospaced computer typeface. We have tried to be consistent in our use of uppercase and lowercase for keywords and object names. However, because the default installation of SQL Server doesn’t make a distinction between upper- and lowercase for SQL keywords or object names and data, you might find some of the examples presented in either upper- or lowercase.
Code and output examples are presented separately from regular paragraphs and are also in a monospaced computer typeface. The following is an example:
select object_id, name, type_desc from sys.objects where type = 'SQ' object_id name type_desc ----------- ------------------------------- ------------- 1977058079 QueryNotificationErrorsQueue SERVICE_QUEUE 2009058193 EventNotificationErrorsQueue SERVICE_QUEUE 2041058307 ServiceBrokerQueue SERVICE_QUEUE
When syntax is provided for a command, we have attempted to follow these conventions:
Consider the following syntax example:
grant {all | permission_list} on object [(column_list)] to {public | user_or_group_name [, [...]]}
In this case, object is required, but column_list is optional. Note also that items shown in plain computer type, such as grant, public, and all, should be entered literally, as shown. (One exception to this is any argument with the “_name” suffix, which is a placeholder for the specified object name that must be provided.) Placeholders are usually presented in monospaced italic, such as permission_list and user_or_group_name. A placeholder is a generic term for which you must supply a specific value or values. Also, any values enclosed in angle brackets (< >) indicate a specific value that needs to be provided. The ellipsis ([...]) in the square brackets following user_or_group_name indicates that multiple user or group names can be specified, separated by commas. You can specify either the keyword public or one or more user or group names, but not both.
Most of the examples presented in this book make use of the AdventureWorks2012 database, which is not automatically installed with SQL Server 2014 nor included with the SQL Server installation media. To install the AdventureWorks2012 sample database, you must first download the installer from the Microsoft SQL Server Samples and Community Projects website at http://sqlserversamples.codeplex.com.
Some of the chapters in the Part VII, “SQL Server Business Intelligence Features,” make use of a sample database called CompSales. The CompSales database provides a good star-schema model that represents a real-world production database. To install the CompSales database, follow these steps:
1. Copy the CompSales.mdf file into the SQL Server data folder where you want it to reside.
2. Ensure that the Read-Only property of the CompSales.mdf file is not enabled.
3. Attach the CompSales database by using a command similar to the following. (Edit the path to match the location of the CompSales.mdf file on your system.)
sp_attach_single_file_db 'CompSales', N'D:\MSSQL\DATA\MSSQL.1\MSSQL\Data\CompSales.mdf
Good Luck!
If you have purchased this book, you are on your way to getting the most from SQL Server 2014. You have already chosen a fine platform for building database applications, one that can provide outstanding performance and rock-solid reliability and availability at a reasonable cost. With this book, you now have the information you need to make the best of it.
Many of us who worked on this book have been using SQL Server since it was first released. Writing about each new version challenges us to reassess our understanding of SQL Server and the way it works. It’s an interesting and enjoyable process, and we learn a lot writing each of these books. We hope you get as much enjoyment and knowledge from reading this book as we have from writing it.