I have a little solution that I want to share with today's DBAs but I'm really uncertain that the problem it solves is still of interest to anyone. for some reason, the "answer your own question" pattern looks all wrong to me in this case.
The solution is a little Powershell script that solves a very particular problem in string manipulation. It's a table driven template expander. The driver table has one column for each variable in the template, and one row for each expansion to be produced. It's really absurdly simple Powershell stuff. I'm a rank beginner at scripting, unless you want to consider VMS DCL a scripting language.
The reason I bring this to DBA is that this solution is a rewrite of a DCL procedure that I wrote to do the same thing 20 years ago. I could then come up with templates that looked sort of like this:
Grant $privs To $user On $table;
Then come up with a driver table using SQL, run it through my tool, desk check the result, and finally execute it once I was sure it was what I wanted to do.
But the question I present here is this: is anybody still doing DBA work this way anymore? I look at the powershell scripts that current DBAs submit, and they all connect to to the database on the fly, and directly perform the required task. My solution is a lot less automatic than that. Is there anybody interested in doing this kind of thing today?
so I'm in "Jeopardy" here: I have the answer but what is the question?
Both answers were useful, and led me to unexpected outcomes.
Somebody came along and asked a question over in SO that was real close to what I was trying to accomplish in my tool. Here is the question, asked by somebody named Mike.
It fit, so I posted my tool as the answer, with a pointer as to how Mike might apply my technique to his problem. Mike accepted it as correct, so I guess I was on target. The exclamation point on his thank you note says it all.
I learned about Poshcode over in SO. That turns out to be the right place to give the tiny script I wrote the widest exposure. So that's what I did, instead of creating my own blog. My biggest interest was in getting more people to see the technique.