Archive | SQL RSS feed for this section

Preserving White Space in ‘Empty’ XML Elements

29 Dec

Introduction
When setting the value of an XML column, so-called ‘insignificant’ white space can be removed. Generally this is not an issue but if the white space is required there are a couple of ways to prevent this.
Continue reading

Advertisements

OPENXML – Basic Examples

22 Dec

Introduction
OPENXML is used to produce a rowset over an XML document. It isn’t something I’ve ever used and it took a while to understand the use of flags that it can use. The following article contains several examples, using the various flag settings as well as an example of the metaproperty attributes.
Continue reading

XMLNAMESPACES – Basic Example

19 Dec

Introduction
I tend not to use XML very often, so have limited experience with it. Whilst reading Itzik Ben-Gan’s (b|t) book for 70-761 I came across XMLNAMESPACES for the first time.
The section on this aspect is quite brief, so this blog contains the additional work I used to ensure I understood it.
Continue reading

Monitoring the Version Store in SQL Server 2017

14 Nov

Introduction
A couple of years a go I wrote an article about monitoring the version store. With SQL Server 2017 a new DMV has been added to make this easier.
Continue reading

Compress and Decompress – Basic Examples

1 Nov

Introduction
Whilst reading Itzik Ben Gan’s excellent book on T-SQL I came across the COMPRESS and DECOMPRESS functions. These could be quite useful for some situations that I have, so decided to have a closer look. Continue reading

Indexing JSON Data in SQL 2016

18 Aug

Introduction
SQL 2016 has introduced support for JSON data. The nature of JSON data means that an indexing strategy isn’t as obvious. This article details my initial work, testing various methods for accessing the JSON data. Continue reading

SSIS – Importing CSV Files that have different number of columns

28 Jul

Background
Recently I had to write an SSIS package that would import a series of csv files that had different numbers of columns within them. One file might have 15 columns, another 17 and another have something different again. Continue reading