Experiment First

Not too long ago, I had a sales engineer contact me about a script that a customer needed. It was similar to others we have for various Redgate tools, but also different enough that the customer needed help. In fact, I also needed some help.

I asked a question on Twitter, mostly because I was busy and wanted to know if someone had solved the (partial) problem that I had. I got a number of responses, none of which were direct solutions, but many of them contained some hints. At the time, I filed these away because I didn’t have time to work on anything, but I knew that asking the question gave me a few starting places.

A day later, I started to experiment, but ran into a few issues. The PoSh script wasn’t doing what I expected, which is always frustrating. I almost started to ask questions, but then I decided to work through the process. After all, I’d already interrupted friends on Twitter with my original question, and I ought to experiment a bit before I asked others to do my work for me.

This was a script designed to find the latest files and build a restore. My first problem was that no data came back from the backup set. I double-checked my data, but didn’t see anything. I then set a variable for the parameter and another to get results. I started to get some information, which led me to review my work again. I realized I’d mis-typed something as a direct parameter, but had corrected it in the variable assignment. First lesson, really proofread carefully.

The data I first got back didn’t quite make sense, so ran this through Get-Member. I didn’t find any property that looks like what I wanted, at least not intuitively. Rather than ask or post a question, I started just checking properties. Eventually I realized the data was there, but not under the name I’d have used or expected. Sometimes just digging through the properties and methods is the best way to learn.

Lastly, with a bunch of data in my object, I needed the top 1 item. Stack Overflow helped point me in the right direction, and I solved my own issue by reading a few different things people had done. With a little research and experimentation, started off by a few questions of others, I had a script that I could give to a customer.

While our management might expect us to know everything about our jobs, often they know this isn’t the case. Technology and platforms change quickly and expand widely to the point that few of us know everything about anything. What management and others really expect is that we can learn to solve our own problems, with some help from others, but also some ability to learn and experiment.

At SQLServerCentral, we have great forums for SQL Server questions. Stack Overflow is a great spot for lots of general technology queries. Plenty of people are willing to help, but often with some sketch of a solution, expecting you to do some work to mock a scenario and then take answer and adapt them to your environment.

There are lots of people in the world willing to help you, but they don’t want to do your job. Ask questions when you don’t know, but also plan to spend your own time experimenting and learning about how and why an answer might work. Before you post a followup question, be sure you experiment and see what you can teach yourself. You will likely learn something and maybe next time you’ll be the one answering a question for someone else.

Steve Jones

Listen to the podcast at Libsyn, Stitcher or iTunes.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Editorial and tagged . Bookmark the permalink.