How I split a row by columns in MS SQL

PR Code - Christopher Pateman
1 min readSep 9, 2019

--

Sometimes we just want to spit the rows in a table by the columns values because that is what SQL is for. This is no easy task depending on your data structure and lead to some complex queries. So here is the road to how to separate the columns data into each row that I followed.

Let’s start with the example table to show how the table would be set, so that you know where this is all coming from. At minimal we need the primary ID that defines the unique row and the column that will be split into multiple rows, for example.

Continue Reading Full Story at http://prcode.co.uk on September 9, 2019.

--

--

PR Code - Christopher Pateman
PR Code - Christopher Pateman

Written by PR Code - Christopher Pateman

I’m a Azure DevOps Engineer with a wide knowledge of the digital landscape. I enjoy sharing hard to find fixes and solutions for the wider community to use.

No responses yet