-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Gavin Draper's SQL Server Blog

Software Dev/DBA living the dream in sunny Brighton, UK. I've been playing with SQL Server about nearly 20 years now and still feel just as clueless as I did back then. I love writing about things I find as I go along.

Archives: June 2017

Level Up Your SQL Server Cross Platform Skills With mssql-scripter

The ability to export a script of database objects has for a long time been a feature of SQL Server Management Studio. With the new OSS cross platform tooling from Microsoft we can now have ths feature everywhere. mssql-scripter allows you to export schema and or data from SQL Server… Read more

0 comments, 22 reads

Posted in Gavin Draper's SQL Server Blog on 27 June 2017

SQL Server 2017 Concatenation With STRING_AGG

One of the new less publicized features in SQL Server 2017 is STRING_AGG. This new feature can take an expression of string values and concatenate them with a specified separator.

There’s not much more to say about it other than that really, so lets look at an example. Imagine we… Read more

0 comments, 37 reads

Posted in Gavin Draper's SQL Server Blog on 20 June 2017

SQL Server Installed and Running on macOS In Less Than 5 Minutes (With Video)

SQL Server 2017 is the first version of SQL Server that will also run natively on Linux and on macOS via Docker. There has never been a quicker way to get SQL Server installed and running in a development environment than using this new Docker image.

This is a video… Read more

0 comments, 20 reads

Posted in Gavin Draper's SQL Server Blog on 19 June 2017

SQL Server 2017 Graph Data Features In Action

The Wikipedia Graph Database page has the following definition…

In computing, a graph database is a database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data. A key concept of the system is the graph (or edge or relationship), which directly relates…

Read more

0 comments, 31 reads

Posted in Gavin Draper's SQL Server Blog on 12 June 2017

SQL Server 2016 Row Level Security In Action

Row Level security was introduced with SQL Server 2016 and allows us to specify predicates for what rows can be accessed in the context of for example the logged in user.

For the example in this post imagine we have a multi tenant database and currently the walls that stop… Read more

0 comments, 25 reads

Posted in Gavin Draper's SQL Server Blog on 7 June 2017

SQL Server 2016 What's New With TSQL

DROP IF EXISTS

This allows us to drop objects without first having to check if they exist. It works on pretty much every object you could want to drop and changes this…

IF OBJECT_ID (N'MyDatabase.MySchema.MyTable', N'U') IS NOT NULL 
    DROP TABLE MyTable

To this…

DROP

Read more

0 comments, 26 reads

Posted in Gavin Draper's SQL Server Blog on 6 June 2017

SQL Server Application Roles

If you’re using Windows Authentication then you probably have a database user for each user of your application or at least the relevant groups for them. This makes permissioning a lot easier as we can only allow users certain users to certain resources. For example if an app is using… Read more

0 comments, 17 reads

Posted in Gavin Draper's SQL Server Blog on 5 June 2017

SQL Server Debugging BAD_PAGE_PROCESS Waits

I was recently debugging a slow running SQL instance, when checking the wait stats I noticed a lot of BAD_PAGE_PROCESS waits…

SELECT * FROM sys.dm_os_wait_stats ORDER BY wait_type

The MSDN description of this wait type is

Occurs when the background suspect page logger is trying to avoid running…

Read more

0 comments, 24 reads

Posted in Gavin Draper's SQL Server Blog on 3 June 2017

SQL Server Dynamic Data Masking In Action

One of the new features SQL Server 2016 introduced is Dynamic Data Masking. This feature allows sensitive data to be masked at the database layer with no changes to the application.

Demo Time

Run the following script in a new database to setup a sample table.

CREATE TABLE dbo.

Read more

0 comments, 25 reads

Posted in Gavin Draper's SQL Server Blog on 1 June 2017