Making Developers lives easier with SQL Server 2016

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Concepts of Database Management Sixth Edition
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Module 9 Designing an XML Strategy. Module 9: Designing an XML Strategy Designing XML Storage Designing a Data Conversion Strategy Designing an XML Query.
Creating a SharePoint App with Microsoft Access Services
ASP.NET Programming with C# and SQL Server First Edition
Chapter 4 The Relational Model 3: Advanced Topics Concepts of Database Management Seventh Edition.
Module 7: Fundamentals of Administering Windows Server 2008.
Developers of a suite of products to help you monitor and optimize Windows/SQL Server performance o Performance Advisor – awareness and control over Windows.
Searching Business Data with MOSS 2007 Enterprise Search Presenter: Corey Roth Enterprise Consultant Stonebridge Blog:
Visual Programing SQL Overview Section 1.
XML and Database.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
SQL Server 2016 Security Features Marek Chmel Microsoft MVP: Data Platform Microsoft MCT: Regional Lead MCSE: Data Platform Certified Ethical Hacker.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
11 DEPLOYING AN UPDATE MANAGEMENT INFRASTRUCTURE Chapter 6.
Session Name Pelin ATICI SQL Premier Field Engineer.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
SQL Database Management
Introduction to Mongo DB(NO SQL data Base)
Azure SQL Database Updates
Database and Cloud Security
SQL Server getting closer to
SQL SERVER MANAGEMENT STUDIO
Increasing your Coding Speed in SQL Server Management Studio
With Temporal Tables and More
Development Environment
Developing modern applications with Temporal Tables and JSON
Visual Basic 2010 How to Program
Chapter 2: The Visual Studio .NET Development Environment
Visual Studio Database Tools (aka SQL Server Data Tools)
Dynamic SQL Writing Efficient Queries on the Fly
Microsoft Office Access 2010 Lab 2
Introduction to Visual Basic 2008 Programming
Making Developers lives easier with SQL Server 2016
Dynamic SQL: Writing Efficient Queries on the Fly
Data Definition and Data Types
Increasing your Coding Speed in SQL Server Management Studio 2017
Increasing your Coding Speed in SQL Server Management Studio 17
SQL Server Monitoring Overview
Digital Forensics 2 Lecture 2A: Obfuscation and Synchronization of
Making Developers lives easier with SQL Server 2016
Data Virtualization Tutorial: JSON_TABLE Queries
Searching Business Data with MOSS 2007 Enterprise Search
Dynamic SQL Writing Efficient Queries on the Fly
SQL Server 2016 JSON Support FOR Data Warehousing
Database Performance Tuning and Query Optimization
Searching Business Data with MOSS 2007 Enterprise Search
CIS16 Application Development – Programming with Visual Basic
SQL Server 2016 Query Data Store
Visual Studio Database Tools (aka SQL Server Data Tools)
Dynamic SQL: Writing Efficient Queries on the Fly
A JSON’s Journey through SQL Server
What’s new with SQL Server
JSON for the Data Mortal
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Integrating REST API and SQL Server JSON Functions
Chapter 7 Using SQL in Applications
Chapter 11 Database Performance Tuning and Query Optimization
Developing and testing enterprise Java applications
Diving into Query Execution Plans
Chapter 11 Managing Databases with SQL Server 2000
Objectives In this lesson, you will learn to:
Unit J: Creating a Database
Samir Behara, Senior Developer, EBSCO
Presentation transcript:

Making Developers lives easier with SQL Server 2016 Samir Behara, Senior Developer, EBSCO dotnetvibes.com @samirbehara

Senior Developer, EBSCO Has a Bachelor Degree in Computer Science with 11 years of IT experience. Works as a Senior Developer and builds software solutions using cutting edge technologies, primarily C# and SQL Server. Co-Chapter Lead of the Steel City SQL Server Users Group – which is the Birmingham, AL chapter of PASS. Author of www.dotnetvibes.com SAMIR BEHARA Senior Developer, EBSCO /samirbehara @samirbehara samirbehara

Agenda Performance Productivity Security Live Query Statistics JSON Support Dynamic Data Masking Query Store Temporal Tables TSQL Enhancements

SQL Server Management Studio 2016

SSMS 2016 is FREE. SSMS is an independent web installer. SSMS is decoupled from the underlying SQL Server Engine. SSMS now uses Visual Studio 2015 isolated shell. More frequent releases for new features, enhancement and bug fixes.

SSMS 2016 Enhancements Color Theme Navigation Buttons Automatic Check for Updates Quick Launch Color Theme Vertical Scroll Bar Enhancements Execution Plan Window Improvements Compare Execution Plans New Installation Experience

Live Query Statistics

Have you come across this scenario? You execute a TSQL Query and it just runs and runs, without displaying any results and you finally end up cancelling the executing query. How do you troubleshoot this problem?

Collect actual metrics of the query while it is running…

Benefits of Live Query Statistics Real Time Insights into SQL Query Execution Process Troubleshoot long running queries Visually track overall query progress

How to enable Live Query Statistics? Using SQL Server Management Studio Using Activity Monitor

Query Store

Have you come across this scenario? There is a temporary performance issue with your application and you realize that your queries are running slow all of a sudden. TSQL queries slow down after a server/application upgrade. You are trying to troubleshoot a performance issue but don’t have any historical information on how the query ran over a period of time.

What is Query Store? A new feature in SQL Server 2016 which collects and presents detailed historical information of queries, execution plans and run-time statistics. Gives the SQL developers/DBAs lot more control and insight into the query performance issues. Directly integrated in SQL Server. No need of any 3rd party performance monitoring tool. Simple to use – Graphical user interface built into SSMS.

What does Query Store do? Store history of execution plans and statistics of each query Baseline performance metrics and track deviations Diagnosing Performance Issues after upgrades Displays customizable UI reports

How does Query Store work? Compile Execute Plan Store Runtime Stats Query Store

What are the various built in Query Store reports? Types of Reports Description Regressed Queries Shows all the queries whose Execution Plan worsened over a period of time. Overall Resource Consumption  Shows summary of the query runtime statistics executed during a time interval. Top Resource Consuming Queries Shows most expensive queries executed during a time interval, based on Duration, CPU Time, Logical/Physical Reads, Memory consumption. Tracked Queries Shows the historic runtime statistics of a specific query.

Query Store Demo

Temporal Tables

Temporal Tables A new type of system-versioned user table that holds the entire history of data changes. Temporal Table in SQL Server 2016 provides inbuilt support for tracking old versions of data over a period of time, without any need for additional programming.

Why is Temporal required? Time Travel Simplify Data Audit Trend Analysis Repair Corruptions

How Temporal Data works? Temporal Table History Table Old Versions Update/ Delete Insert/ Bulk Insert

Temporal Tables Demo

JSON Support

Why JSON? Javascript Object Notation is a lightweight data interchange format which helps to communicate between client and server side technologies. JSON is considered as the best tool for sharing data, because the data is stored in an array format. This makes data transfer easier since the array structure is pretty much familiar to object oriented languages.

What are the advantages of JSON over XML? JSON is lightweight in comparison to XML and has a smaller message size. In JSON, data is stored in arrays whereas in XML data is stored in trees, hence XML needs to be first transformed before it can be imported. JSON parsing is generally faster than XML parsing. Because of the similarity in syntax, JSON is easier to be handled with Javascript. Formatted JSON is generally easier to read than formatted XML. Due to its simplicity, JSON runs faster and consumes lesser memory.

How to format query results as JSON? SQL Server 2016 provides built-in support for storing, managing and parsing JSON data. There is no separate JSON data type created, like XML – rather JSON is represented by NVARCHAR datatype. FOR JSON clause allows us to format query results as JSON text. Appending this syntax to a standard TSQL query returns the result set in JSON format. FOR JSON clause types Description FOR JSON AUTO JSON is formatted by the database engine based on the order of the columns in the SELECT statement. FOR JSON PATH JSON is formatted based on the user’s discretion. It gives us full control over the format of the JSON output.

How to transform JSON text to relational table? OPENJSON function can be used to convert JSON text into table rows and columns or to import JSON into SQL tables. By default, when we use the OPENJSON function, it returns 3 values – key, value and type. Type Value JSON Data Type NULL 1 STRING 2 INT 3 BOOL 4 ARRAY 5 OBJECT

JSON Functions There are a number of newly added JSON functions to provide support for handling JSON data – Function Name Description ISJSON() Verifies that the text has valid JSON data. JSON_QUERY() Extract JSON fragment from JSON text. JSON_VALUE() Extract value from JSON text. JSON_MODIFY() Add, Delete or Update properties in JSON text

JSON Functions Demo

T-SQL Enhancements

DROP IF EXISTS Statement Syntax – DROP OBJECT_TYPE [ IF EXISTS ] OBJECT_NAME Example - DROP TABLE IF EXISTS dbo.Employee DROP IF EXISTS conditionally drops the column or constraint only if it already exists. If the object does not exist, it will not throw any error and the TSQL execution will continue on. Applies to – Database, Table, Function, Trigger, Stored Procedure, Column, User, View, Schema, Index , Role

STRING_SPLIT() Function Syntax - STRING_SPLIT ( string , separator ) STRING_SPLIT is a T-SQL function that splits an input string by a separator and outputs the results as a table.

COMPRESS and DECOMPRESS Function COMPRESS – Compress data using GZip algorithm and returns binary data. DECOMPRESS – Decompress binary data using GZip algorithm and returns binary data. You will need to cast binary data to text to get the original compressed text. You can compress data in Client Side and send compressed data to SQL Server. You can compress data in SELECT query and decompress it in the Client side.

DATEDIFF_BIG Function Syntax – DATEDIFF_BIG ( DatePart , StartDate , EndDate ) This new function gives the difference between the two dates (StartDate and EndDate) in the units specified by the DatePart parameter and the returned unit is of type bigint.   It is very much similar to the DATEDIFF function, difference being that DATEDIFF function return type is INT, whereas the DATEDIFF_BIG functions return type is BIGINT.

Dynamic Data Masking

What is Dynamic Data Masking? A new built-in security feature which will limit access to sensitive information by masking stored data. We can configure users who can have access to the unmasked data and for other unauthorized users, just show the masked data. Data is masked on the fly and the underlying data in the database does not change. Very simple to enable this feature in existing databases. No need of any application changes to take advantage of this functionality. Not a replacement for encryption.

What are the different Masking functions available? Description DEFAULT() This method can be described as Full masking. It replaces the content of the column with ‘XXXX’. EMAIL() This method exposes the first letter of the email address and the constant suffix ‘.com’. It converts the email-id to the format aXXX@XXX.com PARTIAL() This method exposes the first and the last letters and adds a custom padding string in the middle. RANDOM() This method is used to mask numeric types with a random value within a specified range.

How does Dynamic Data Masking work? Security Officer defines the Data Masking Policy for sensitive data. Admin Other Users

Dynamic Data Masking Demo

@samirbehara samirbehara@gmail.com dotnetvibes.com