Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
SQL Server 2016 Developer's Guide
SQL Server 2016 Developer's Guide

SQL Server 2016 Developer's Guide: Build efficient database applications for your organization with SQL Server 2016

Arrow left icon
Profile Icon Dejan Sarka Profile Icon Radivojević Profile Icon William Durkin
Arrow right icon
€49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (8 Ratings)
Paperback Mar 2017 616 pages 1st Edition
eBook
€27.98 €39.99
Paperback
€49.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Dejan Sarka Profile Icon Radivojević Profile Icon William Durkin
Arrow right icon
€49.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (8 Ratings)
Paperback Mar 2017 616 pages 1st Edition
eBook
€27.98 €39.99
Paperback
€49.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€27.98 €39.99
Paperback
€49.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

SQL Server 2016 Developer's Guide

Chapter 2. Review of SQL Server Features for Developers

Before delving into the new features in SQL Server 2016, let's have a quick recapitulation of the features of SQL Server for developers already available in the previous versions of SQL Server. Recapitulating the most important features will help you remember what you already have in your development toolbox and also understand the need and the benefits of the new or improved features in SQL Server 2016.

Tip

This chapter has a lot of code. As this is not a book for beginners, the intention of this chapter is not to teach you the basics of database development. It is rather a reminder of the many powerful and efficient Transact-SQL (T-SQL) and other elements included in SQL Server version 2014 and even earlier.

The recapitulation starts with the mighty T-SQL SELECT statement. Besides the basic clauses, advanced techniques such as window functions, common table expressions, and the APPLY operator are explained. Then, you...

The mighty Transact-SQL SELECT

You probably already know that the most important SQL statement is the mighty SELECT statement you use to retrieve data from your databases. Every database developer knows the basic clauses and their usage:

  • SELECT to define the columns returned, or a projection of all table columns
  • FROM to list the tables used in the query and how they are associated, or joined
  • WHERE to filter the data to return only the rows that satisfy the condition in the predicate
  • GROUP BY to define the groups over which the data is aggregated
  • HAVING to filter the data after the grouping with conditions that refer to aggregations
  • ORDER BY to sort the rows returned to the client application

Besides these basic clauses, SELECT offers a variety of advanced possibilities as well. These advanced techniques are unfortunately less exploited by developers, although they are really powerful and efficient. Therefore, I advise you to review them and potentially use them in your applications. The advanced...

DDL, DML, and programmable objects

As a developer, you are often also responsible to create database objects. Of course, in an application, you also need to insert, update, and delete the data. In order to maintain data integrity, enforcing data complies with business rules, you need to implement constraints. In a quick review of the data definition language (DDL) and data modification language (DML) elements, the following statements are presented:

  • CREATE for creating tables and programmatic objects
  • ALTER to add constraints to a table
  • DROP to drop an object
  • INSERT to insert new data
  • UPDATE to change existing data
  • DELETE to delete the data

In a SQL Server database, you can also use programmatic objects. You can use triggers for advanced constraints or to maintain redundant data like aggregated data. You can use other programmatic objects for data abstraction, for an intermediate layer between the actual data and an application. The following programmatic objects are introduced here:

  • Triggers...

Transactions and error handling

In a real-world application, errors always appear. Syntax or even logical errors may be in the code, the database design might be incorrect, there might even be a bug in the database management system you are using. Even if everything works correctly, you might get an error because the users insert wrong data. With Transact-SQL error handling you can catch such user errors and decide what to do upon them. Typically, you want to log the errors, inform the users about the errors, and sometimes even correct them in the error handling code. Error handling for user errors works on the statement level. If you send SQL Server a batch of two or more statements and the error is in the last statement, the previous statements execute successfully. This might not be what you desire. Frequently, you need to execute a batch of statements as a unit, and fail all of the statements if one of the statements fails. You can achieve this by using transactions. In this section...

Beyond relational

Beyond relational is actually only a marketing term. The relational model, used in the relational database management system, is nowhere limited to specific data types or specific languages only. However, with the term "beyond relational," we typically mean specialized and complex data types that might include spatial and temporal data, XML or JSON data, and extending the capabilities of the Transact-SQL language with CLR languages such as Visual C#, or statistical languages such as R. SQL Server in versions before 2016 already supports some of the features mentioned. Here is a quick review of this support that includes:

  • Spatial data
  • CLR support
  • XML data

Defining locations and shapes with Spatial Data

In modern applications, often you want to show your data on a map, using the physical location. You might also want to show the shape of the objects that your data describes. You can use spatial data for tasks like these. You can represent the objects with points...

The mighty Transact-SQL SELECT


You probably already know that the most important SQL statement is the mighty SELECT statement you use to retrieve data from your databases. Every database developer knows the basic clauses and their usage:

  • SELECT to define the columns returned, or a projection of all table columns

  • FROM to list the tables used in the query and how they are associated, or joined

  • WHERE to filter the data to return only the rows that satisfy the condition in the predicate

  • GROUP BY to define the groups over which the data is aggregated

  • HAVING to filter the data after the grouping with conditions that refer to aggregations

  • ORDER BY to sort the rows returned to the client application

Besides these basic clauses, SELECT offers a variety of advanced possibilities as well. These advanced techniques are unfortunately less exploited by developers, although they are really powerful and efficient. Therefore, I advise you to review them and potentially use them in your applications. The advanced...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Utilize the new enhancements in Transact-SQL and security features in SQL Server 2016 to build efficient database applications
  • Work with temporal tables to get information about data stored in the table at any point in time
  • A detailed guide to SQL Server 2016, introducing you to multiple new features and enhancements to improve your overall development experience

Description

Microsoft SQL Server 2016 is considered the biggest leap in the data platform history of the Microsoft, in the ongoing era of Big Data and data science. This book introduces you to the new features of SQL Server 2016 that will open a completely new set of possibilities for you as a developer. It prepares you for the more advanced topics by starting with a quick introduction to SQL Server 2016's new features and a recapitulation of the possibilities you may have already explored with previous versions of SQL Server. The next part introduces you to small delights in the Transact-SQL language and then switches to a completely new technology inside SQL Server - JSON support. We also take a look at the Stretch database, security enhancements, and temporal tables. The last chapters concentrate on implementing advanced topics, including Query Store, column store indexes, and In-Memory OLTP. You will finally be introduced to R and learn how to use the R language with Transact-SQL for data exploration and analysis. By the end of this book, you will have the required information to design efficient, high-performance database applications without any hassle.

Who is this book for?

This book is for database developers and solution architects who plan to use the new SQL Server 2016 features for developing efficient database applications. It is also ideal for experienced SQL Server developers who want to switch to SQL Server 2016 for its rich development capabilities. Some understanding of the basic database concepts and Transact-SQL language is assumed.

What you will learn

  • Explore the new development features introduced in SQL Server 2016
  • Identify opportunities for In-Memory OLTP technology, significantly enhanced in SQL Server 2016
  • Use columnstore indexes to get significant storage and performance improvements
  • Extend database design solutions using temporal tables
  • Exchange JSON data between applications and SQL Server in a more efficient way
  • Migrate historical data transparently and securely to Microsoft Azure by using Stretch Database
  • Use the new security features to encrypt or to have more granular control over access to rows in a table
  • Simplify performance troubleshooting with Query Store
  • Discover the potential of R s integration with SQL Server
Estimated delivery fee Deliver to Czechia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 22, 2017
Length: 616 pages
Edition : 1st
Language : English
ISBN-13 : 9781786465344
Vendor :
Microsoft
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Czechia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Publication date : Mar 22, 2017
Length: 616 pages
Edition : 1st
Language : English
ISBN-13 : 9781786465344
Vendor :
Microsoft
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 145.97
SQL Server 2017 Administrator's Guide
€45.99
SQL Server 2017 Integration Services Cookbook
€49.99
SQL Server 2016 Developer's Guide
€49.99
Total 145.97 Stars icon
Banner background image

Table of Contents

14 Chapters
1. Introduction to SQL Server 2016 Chevron down icon Chevron up icon
2. Review of SQL Server Features for Developers Chevron down icon Chevron up icon
3. SQL Server Tools Chevron down icon Chevron up icon
4. Transact-SQL Enhancements Chevron down icon Chevron up icon
5. JSON Support in SQL Server Chevron down icon Chevron up icon
6. Stretch Database Chevron down icon Chevron up icon
7. Temporal Tables Chevron down icon Chevron up icon
8. Tightening the Security Chevron down icon Chevron up icon
9. Query Store Chevron down icon Chevron up icon
10. Columnstore Indexes Chevron down icon Chevron up icon
11. Introducing SQL Server In-Memory OLTP Chevron down icon Chevron up icon
12. In-Memory OLTP Improvements in SQL Server 2016 Chevron down icon Chevron up icon
13. Supporting R in SQL Server Chevron down icon Chevron up icon
14. Data Exploration and Predictive Modeling with R in SQL Server Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(8 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Jeff Miller May 15, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Wanted to know how SQL Server implemented JSON, and they had just the right amount of documentation and examples. I put together a hybrid relational/document DB schema together with this books help.Beyond JSON, I found the book to be well put together and had a great mix of example code and verbiage to get their points across.Well done!
Amazon Verified review Amazon
Saveloy Sep 09, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book for the professional....
Amazon Verified review Amazon
OldSkuLL84 Oct 27, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Gives deep knowledge about the new features of SQL Server 2016. I would skip the R chapters.
Amazon Verified review Amazon
Ian Stirk Jul 05, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Hi,I have written a detailed chapter-by-chapter review of this book on www. DOT i-programmer DOT info, the first and last parts of this review are given here. For my review of all chapters, search i-programmer DOT info for STIRK together with the book's title.This book aims to provide best practices and example architectures for Hadoop technologists, how does it fare?This book aims to introduce you to the salient new and enhanced features in SQL Server 2016, how does it fare?This book is aimed at SQL Server developers and architects that want to understand the latest features in SQL Server 2016. The ideal reader would be an intermediate-level developer with experience of SQL Server 2014, that said, the book does cover some background material from previous versions of SQL Server where appropriate.In many ways, SQL Server 2016 removes many of the limitations found in SQL Server 2014 (especially In-Memory OLTP), as well as implementing other useful developer features.Below is a chapter-by-chapter exploration of the topics covered.Chapter 1 Introduction to SQL Server 2016The book’s opening chapter provides an overview of the new and enhanced SQL Server 2016 features that are subsequently detailed in the rest of the book. There’s a brief overview of the recent history of SQL Server, culminating in Microsoft’s “Mobile First, Cloud First” strategy. Next, security enhancements are highlighted (row level security, dynamic data masking, always encrypted).The chapter continues with an overview of the major SQL Server engine enhancements, namely: -Query Store (troubleshooting sudden performance changes) -Live Query Statistics (real-time analysis of performance) -Stretch Database (offload older data to slower/cheaper storage) -Database scoped configuration (some server-level settings now set at database-level) -Temporal Tables (easier table history/versioning) -Columnstore indexes (now updateable)Programming enhancements are outlined next, including new T-SQL functions, and JSON (a “better” XML). Business Intelligence has been enhanced with the incorporation of the language R into SQL Server. The chapter ends with a look at the increasing frequency of software releases.This chapter provides a useful, if very brief, overview of the major new and enhanced features in SQL Server 2016, it also highlights what to expect from the rest of the book, where these features are examined in greater detail. It is generally easy to read, with useful explanations, tips, example code, and diagrams. These traits apply to the whole of the book....ConclusionThis book aims to introduce you to the salient new and enhanced features in SQL Server 2016, and succeeds. It is generally easy to read, well written, with useful explanations, tips, example code, and diagrams.Whilst the book doesn’t cover all the new features (e.g. PolyBase), it does cover the major ones. I suspect the more you know about SQL Server already, the more useful this book will be. Since the book focuses on new and enhanced features, large subject areas are omitted (e.g. database design).Sometimes, before discussing an extended feature (e.g. In-Memory OLTP), a large amount of background information is given with reference to previous editions of SQL Server. Whilst this may be useful if you don’t know the feature, it could be argued it is unnecessary - if you already know SQL Server 2014.It might have been useful to include a section discussing SQL Server changes in terms of some of the industry’s wider trends (e.g. Big Data, Social Media, the Cloud).Overall, if you want to know more about the new and enhanced features in SQL Server 2016, I can recommend this well-written book.
Amazon Verified review Amazon
Amazon Customer Nov 30, 2017
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I like this book as its easy to read have screenshots to understand and easy to finish.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela