Friday, April 14, 2017

Custom SQL Server Function to Get By Delimiter (and index)

Had to look for over 30 minutes to figure this one out.  A simple split function in SQL does not exist. Almost all solutions point you to a table as result.  But I was looking for a simple function that would allow me to split a string by delimiter and let me pick a certain index.

Something like :

getByDelimiter('hi|ho|hey','|',1) => "hi"
getByDelimiter('hi|ho|hey','|',2) => "ho"
getByDelimiter('hi|ho|hey','|',3) => "hey"

I finally found a solution on the web (but had to bugfix it)

Monday, April 10, 2017

Backup and Restore WFA with Perl

My colleague (Warren Barnes) wrote this Perl script.  Apparently it is now possible to restore with rest as well.  (maybe it always was, but I couldn't figure it out).  So if I can find the time, I'll adapt my PowerShell version as well to restore with rest.