Word: 376
Time to read: ~ 2 minutes
Update 17-Jan-2019: Turns out my first SQL Saturday in Ireland was up in Dublin, thanks Bartosz Ratajczyk for reminding me!
Category: General
Reflections: 2018
What a Difference a Year Makes
Words: 665
Time to read: ~ 3 minutes
2018 has been a busy year.
Blog
Let’s talk blog numbers for a moment… They say a picture paints a thousand words so I’m going to keep the word count down.

That’s 42,680 views across 34,920 visitors. Now seeing as last year it was 11,079 views across 9,061 visitors and that’s a 285% increase…yeah I’m pretty damn happy with that!
2018 was the year that I started to get more and more into the PowerShell community so I’m happy that 3 out of the top 4 posts were about topics that merges both the SQL Server and PowerShell communities.

- Wait! There are JOINS in PowerShell???
- Dealing with System.Data.DataRow
- Turning off Passive Voice spell-check in Word 2016
- Importing Excel into SQL Server using PowerShell
I’m not going to read into the fact that my post with the highest views of 2018 was about me being a fan-boy of the work of somebody else. Mainly because it’s awesome and I’m a fan-boy of the work of a lot of people.
As for the Passive voice post, well it annoyed me and I was so happy to find the answer that I had to blog about it. Thank you to a certain German Fashion magazine forum for continuously sending traffic my way because of it!
Travel
SQLBits, SQL Saturday Oslo, SQL Saturday Reading, PSDay UK, etc.
It’s probably been my busiest year with regard to travel. Combine this with my moving back to Ireland from London in June this year and I’ve now reached the age stage where I can’t fully remember where I’ve been.
To combat this, I’ve enabled Google Timelines to help keep track of where I’ve been. Here is what it’s shown me since July 2018.

The amount of information that I’ve been taught, the people that I’ve finally met face to face, the beauty of the places I’ve been definitely makes me want to keep the travel going into 2019!
Shout out to Drew Furgiuele ( blog | twitter ) who I didn’t manage to meet when we were both in SQL Saturday Oslo. We’ll have our coffee/alcohol/workout/handshake eventually!
Learnings
While it has been a busy year for blogging, travelling, and meeting people it has come at a cost. One that I’ve only felt lately when I sat down and tried to a brief forward plan of the upcoming year.
I’ve been receiving an enormous amount of PowerShell help from the PowerShell community. They are extremely welcoming, open, and willing to aid knowledge seekers (so much so that I’m having a fun little argument with them about which community is more welcoming: PowerShell or SQL 🙂 ).
Catching up with some SQL webinars and reading some of the SQL blogging community’s posts has shown me that I haven’t been keeping up to date with the SQL Server announcements and new technologies.
This is something that I am going to have to actively aim to rectify in 2019.
Ideas
2018 was amazing for seeing a small subset of what someone can achieve with the technology out there in the world. To say that I’m bursting with ideas wouldn’t be far from the truth, thanks to a combination of procrastination and under-used time-management skills.
I’m going to be aiming to see if I can turn 2018, the year of ideas, into 2019, the year of actions.
Reflections
Hard to believe that I’ve been blogging for 3 years but this will be the first reflection that I have done.
Overall I’m pleased with what I’ve accomplished, learned, and realised with 2018. Yes, even the realisation that I need to increase my effort on SQL Server learning.
What get’s measured gets done!
Looking forward, I’m not quite sure what’s next. I’ve a couple of SQL Server and PowerShell days/conferences that I’m looking forward to. I suppose it’s time to stop reflecting and start planning.
To everyone who I’ve encountered in 2018, thank you.
To everyone who has encountered me in 2018, I’m sorry. I need more caffeine at the time.
To everyone I’m going to meet in 2019, looking forward to it!
Getting Details from a Maintenance Plan using PowerShell
You must know your enemy before you can replace your enemy…
Words: 400
Time to read: ~ 2 minutes
Continue reading “Getting Details from a Maintenance Plan using PowerShell”
Learning C# methods in PowerShell don’t like -1
Trying to be smart getting me learned!
Words: 432
Time to read: ~ 3 minutes
It’s been a while…
…since I’ve written a blog post and there’s no better way to get back into something than to just start doing. Even if it’s just a throwaway, little post.
So here’s mine. Hope you enjoy it.
Don’t ask why…
… but recently I was trying in PowerShell to split a string up into its individual characters. So, as an example, ‘SQL Server’ would become the ('S', 'Q', 'L', ' ', 'S', 'e', 'r', 'v', 'e', 'r') collection of characters.
I also wanted the character before it and after it as well…
| This Char | Prev Char | Next Char |
| S | r | Q |
| Q | S | L |
| L | Q | |
| L | S | |
| S | e | |
| e | S | r |
| r | e | v |
| v | r | e |
| e | v | r |
| r | e | S |
The Easiest Way…
…that I found was to simply ask for the character a certain position (or index) in the string.
| $String = 'SQL Server' | |
| for ($i = 0; $i -lt $String.Length; $i++ ) { | |
| [PSCustomObject]@{ | |
| 'This Char' = $string[$i] | |
| 'Prev Char' = $string[$i -1] | |
| 'Next Char' = $string[($i +1) % $String.Length] | |
| } | |
| } |

As you can see we had to add a little got’cha to our code: ($i +1) % $String.Length
This is because, without the modulo operator (what remains when we divide the numbers), PowerShell looks for the next index (10) and returns nothing since there is essentially nothing in index 10.
So we ask PowerShell what 10 modulo the length of the string is ( 10 % 10) and the remainder is 0. This way we can wrap back around to the start again!
However, coming from a database background…
…this may seem like a pretty simple exercise, especially since we know that PowerShell has a Substring method.
| $String = 'SQL Server' | |
| 0..($String.Length – 1) | ForEach-Object –Process { | |
| $String.Substring($_, 1) | |
| } |
However, what happens when we try and go backwards i.e. $String.Substring(-1, 1)?
Nope!
Exception calling “Substring” with “2” argument(s): “StartIndex cannot be less than zero.

Try as I might…
…I couldn’t get any way that used “.whatever()” to work. Substring; nope, Chars; nada.
The moment that I passed in a -1 I just saw a sea of red.
Thankfully I’ve been frequenting the PowerShell slack channel lately and they were able to let me know why.
sifb [Nov 12th at 10:01 PM]
@Shane O’Neill I think the $array[-1] loop-around is a powershell convenience, and doesn’t exist in C# / the lower level .Net libraries
So there we go…
…even though we may be used to SubString, it doesn’t mean that it is the best way for us to go. This is technically a new language and there are going to be tips and tricks for doing things that we don’t yet know about!
Half the fun is rooting them out, finding them, and slowly, slowly watching your code improve and knowing why.
I would have written a shorter [post], but I did not have the time.
Another Difference between N” and ” in SQL Server.
If it walks like a ‘duck’, talks like a ‘duck’, and looks like a ‘duck’…careful! It could be a N’duck’
Words: 270
Time to read: around 2 minutes.
Continue reading “Another Difference between N” and ” in SQL Server.”
Change Read-Host to Confirm!
Words: 884
Time to read: ~ 4 minutes
Update: 29-Aug-2018 – Thanks to the good folks in reddit (u/TheIncorrigible1 & u/Ta11ow) who pointed out that Pause is a function, not an alias & a really cool addition to the confirm attribute. Also added the second step I left out of the 1st draft (oops).
T-SQL Tuesday 105: Brick Wall
All in all it’s just another…
Words: 579
Time to read: ~ 3 minutes
DBA Fundamentals August 2018
Words: 857
Time to read: ~ 4 minutes
Figuring out a PowerShell version of Dynamic SQL
Next step is wondering if we can avoid SQL/PowerShell injection…
Words: 569
Time to read: ~ 3 minutes
Continue reading “Figuring out a PowerShell version of Dynamic SQL”
DBA Fundamentals May 2018
I was so disappointed we don’t have a webinar on May the 4th 🙁
Words: 1075
Time to read: ~ 5 minutes
