Read more about the article Dynamic Data Masking (DDM) – Mask query results
Microsoft SQL Server

Dynamic Data Masking (DDM) – Mask query results

Enforcement of the new GDPR will begin in May 2018. One of the cornerstones in GDPR is that an organization must be able to protect sensitive personal information. This can be achieved in many ways and at many different levels, from infrastructure (e.g. monitoring traffic) to protecting individual database records. To protect individual data records, some different techniques are available. Examples are encryption and masking. Masking can be done in a permanent way (e.g. actually replacing a name with random characters), or it can be done dynamically (not replacing the original data, but to mask information at query time). SQL Server 2016 ships with a capability to do this dynamic data masking, DDM, and in this article I’ll cover the basics.

(more…)

Continue ReadingDynamic Data Masking (DDM) – Mask query results
Read more about the article From SQL Server to MSMQ using PowerShell
windows

From SQL Server to MSMQ using PowerShell

How do you get records from a SQL Server table into a MSMQ queue as separate XML messages?

A commonly suggested way to communicate with MSMQ from within SQL Server is to create a CLR assembly. See for instance this article that has a great coverage of how to use CLR in this scenario. Note however that you have to import the System.Messaging.dll as unsafe for this to work. And you have to enable CLR obviously.

If this is not an option, another way to do it is to use PowerShell. Which is what I will cover in this demonstration.

(more…)

Continue ReadingFrom SQL Server to MSMQ using PowerShell
Read more about the article Identity columns that are about to overflow
Microsoft SQL Server

Identity columns that are about to overflow

Identity columns are widely used as primary key columns in SQL Server tables. They can be one of the data types TINYINT, SMALLINT, INT, BIGINT, NUMERIC or DECIMAL. Each of these data types has an upper limit and when that upper limit is reached, an error is raised and further inserts into the table are impossible.

(more…)

Continue ReadingIdentity columns that are about to overflow
Read more about the article Temporal Tables Introduction
Microsoft SQL Server

Temporal Tables Introduction

Temporal tables was introduced in SQL Server 2016, and is a technique that simplifies keeping track of changed records in a table. The handling of changes of records in a data warehouse dimension table is a good example of when temporal tables can be useful. In this blog post, I’ll cover the basics of temporal tables.

(more…)

Continue ReadingTemporal Tables Introduction
Read more about the article SQL Agent job logging with tokens
Microsoft SQL Server

SQL Agent job logging with tokens

A useful feature in the SQL Agent is the possibility to use tokens. Tokens are a number of system variables (e.g. $(ESCAPE_SQUOTE(DATE) that contains the current date) that gets expanded/replaced with a value when the job is run. An obvious use of tokens is to create a new log file with today’s date and time in the file name each time an SQL Agent job is run.

(more…)

Continue ReadingSQL Agent job logging with tokens

Toggl Time entries to SQL Server

Toggl is a very simple to use cloud based time tracking application. Time entries on projects and clients can be submitted through the web page or through mobile and desktop applications. Time spent by the team can be viewed in the different reports that can be accessed via their web page. There is a free version that handles much of the time tracking needs, and there are more advanced paid versions as well.

If you want to integrate the information stored at Toggl with your own enviromnent, you can use their API. One way is to download time entries to your own SQL Server database, which is the method I’ll present here.

(more…)

Continue ReadingToggl Time entries to SQL Server

SSISDB.catalog.create_execution

The SSISDB Catalog was introduced in SQL Server 2014. With it came a lot of procedures to manage deployed SSIS projects. The procedures cover running, configuring, managing and troubleshooting SSIS packages.

In this post I will cover a procedure that can be used to run SSIS packages. The procedure is SSISDB.catalog.create_execution.

(more…)

Continue ReadingSSISDB.catalog.create_execution
Read more about the article SQL Server recovery time
Microsoft SQL Server

SQL Server recovery time

SQL Server Recovery time is the time it takes for SQL Server to rollback or roll-forward transaction not yet persisted to the database after a service restart. Transactions that are uncommitted are rolled back, and transactions that are committed but not yet persisted are rolled forward.

Depending on the volume of transactions that needs to be handled during recovery, recovery may take a long time to perform. This affects the time it takes for a SQL Server restart. Another example when recovery times become a factor is when a failover is done in a SQL Server cluster.

So how can we know how long the recovery time will be?

(more…)

Continue ReadingSQL Server recovery time