Thread-safe PowerShell Logging with PSFramework

Andy Levy
In my previous post, I mentioned that I wasn’t checking the status of my RSJobs because I had logging built into my function. I originally tried to log out to plain text files with Out-File, but quickly hit a wall. In a multi-threaded script, attempting to write to the same text file from multiple threads results in collisions and waits at best, and outright failure at worse. Perplexed, I turned to the PowerShellHelp channel in the SQL Community Slack and asked for suggestions for thread-safe logging to text files.

PowerShell Multithreading with PoshRSJob

Andy Levy
Intro PowerShell has had a native method for spawning multiple “threads” ever since I can remember, in the form of the *-Job functions. They work OK, but there are a couple downsides: Each job is its own PowerShell process, so it takes a non-trivial amount of time and memory to spin each up There’s no built-in method for throttling the number of concurrent jobs This combination will become an ugly mess if something spins out of control and you spawn dozens or hundreds of jobs.

Tips for Attending a SQL Saturday

Andy Levy
Matt (blog | twitter) is preparing for his first SQL Saturday presentation next weekend in Washington, DC. He’s asked: I wanted to get an idea of some good, bad, and surprise experiences that people had at everything from a SQL Server User Group meeting to PASS Summit. Things you found out right before, during or even after that you were glad you did or wish you did. Random Thoughts SQL Saturdays are similar to PASS Summit, but much smaller in scope and budget.

PASS Summit 2018 - A Lesson in Personal Branding

Andy Levy
Last year at PASS Summit 2017, I heard a number of comments related to people not recognizing me without the hat in my social media photo/avatar. The linked post started and concluded with the notion that I needed to take a new photo. That never happened. Instead, I embraced The Hat. And it was totally worth it. I got a bit of ribbing from folks early in the week but it was all friendly.

Copying Individual Tables with dbatools

Andy Levy
@SQLMonkeyNYC asked on Twitter this morning: #sqlhelp Does anyone have a product that will back up a single table and restore it to another database? Thanks in advance!! — The SQL Monkey (@SQLMonkeyNYC) November 14, 2018 Pat Phelan replied, suggesting that dbatools can do it, but after thinking on it for a bit and poking at a few functions, I realized that it’s not possible with a single function (yet). No worries.

T-SQL Tuesday #108 - Learning Tech Beyond SQL Server

Malathi Mahadevan (blog|twitter) is hosting this month’s T-SQL Tuesday, a monthly blog party for the SQL Server community. Malathi has asked us to: Pick one thing you want to learn that is not SQL Server. Write down ways and means to learn it and add it as another skill to your resume. If you are already learning it or know it – explain how you got there and how it has helped you.

PASS Summit: Planting Seeds of Knowledge

Andy Levy
On the eve of this year’s PASS Summit, I find myself reflecting on my first Summit in 2012. My employer was generous enough to pay for not only Summit itself, but a pre-con session on Tuesday as well. I was a developer with an interest in SQL Server and PowerShell at the time, not a DBA. Becoming a DBA wasn’t on my radar yet. Regardless, I used the opportunity to attend a full-day class on managing SQL Server with PowerShell, taught by Allen White (blog | twitter).

PASS Summit 2018 - Let's Hang Out! Where to Find Me

Andy Levy
In addition to being an amazing opportunity for both technical and professional development, PASS Summit is a #sqlfamily reunion and a huge networking event. Catching up with old friends, meeting new ones, finding out who’s doing what with which technologies, etc. This is one of the few times each year I’m anything even approaching a social butterfly and I’ve had one or two people ask about my schedule so we can plan meetups.

Here Comes the New Blog. Same as the Old Blog.

Andy Levy
Welcome to the new home of my blog! I’ve had this domain for over a year but with PASS Summit 2018 coming up soon I decided it was time to make the move official. I’ve brought all the content over from the old site but all new content will be appearing here. I’ll throw a new coat of paint on at some point just to freshen things up.