![]() 06/14/2018 at 01:51 • Filed to: None | ![]() | ![]() |
That make it all worthwhile
Pic unrelated
So I’m in a major incident today which has required me to run a SQL query once per hour and report data returned until the data has cleared. Since 2:00 I’ve been doing this manually. Two hours ago my wife went to bed and I said “it’d be nice if I could go to bed too and have these reports auto-run and email”. 1.5 hours ago I started work on a PowerShell function to do just that. 45 minutes ago it was completed and put in production. Now I can cool down and go to bed.
If all goes to plan I will turn my hard-codes into variables and get this function runnable for all package deployments, not just this MI.
![]() 06/14/2018 at 06:32 |
|
Damn, Nibbles. Talk nerdy to me!
![]() 06/14/2018 at 08:06 |
|
![]() 06/14/2018 at 08:47 |
|
This is why everyone should learn some basics about coding. It doesn’t matter what software you are working in. If there are repetitive tasks, there are ways to make your life easier and get better/more consistent results by setting up some code to handle it for you. Tired of importing and processing the same data day after day in Excel? Learn some VBA. Want to automate a complicated geospatial analysis task ArcGIS? Learn Python. Want to create a standalone tool? Learn C++, C#, etc.
The flip side to this is the very real danger of accidentally increasing your workload. Hey, look, BicycleBuck is just sitting there while his computer does his work for him! Let’s find something else for him to work on while he waits!
It’s also a great way to work yourself into a corner. “Yeah, we’d like to move you up to the management position, but we really need your technical skills to keep the project moving forward.”
![]() 06/14/2018 at 08:49 |
|
It’s missing the graph showing relative boredom and longevity on the job. Start work > get bored with repetitive task > quits job because he’s not allowed to automate the task....
![]() 06/14/2018 at 10:16 |
|
Literally my job description right there
![]() 06/14/2018 at 10:44 |
|
For future reference:
![]() 06/14/2018 at 10:50 |
|
$SQLConn.Open();
$reader = $Query.ExecuteReader()
$array = @()
for ( $i = 0 ; $i -lt $reader.FieldCount; $i++ )
{
$array += @($i)
}
$line = $reader.GetName(0)
for ( $i = 1; $i -lt $reader.FieldCount; $i ++)
{
$line += ($(“,” + $reader.GetName($i)))
}
$outfile = @()$outfile += $line
while ($reader.Read())
{
$fieldCount = $reader.GetValues($array);for ($i = 0; $i -lt $array.Length; $i++)
{
if ($array[$i].ToString().Contains(“,”))
{
$array[$i] = ‘”’ + $array[$i].ToString() + ‘”’;
}
}
$outfile += [string]::Join(“,”, $array);
}
![]() 06/14/2018 at 10:54 |
|
It has actually worked me into the most explosive upward movement my career has seen to date. Four years, three promotions, very commensurate raises, and now I’m in talks with the architecture team.
![]() 06/14/2018 at 10:57 |
|
Oh snap!
![]() 06/14/2018 at 11:37 |
|
I’m floating well above the top rung on the ladder for my career track in my current firm. Now I’m trying to switch tracks so I can keep moving up, but I’ve been told several times that they really need to keep me in this position because we don’t have anyone who can step into my place. Then I ask for assistance so I can start training someone, but we never seem to have the budget for it.
![]() 06/14/2018 at 12:15 |
|
Sucks being placed in a box like that. You could always get “real sick” and make ‘em hurt for a bit...
![]() 06/14/2018 at 23:39 |
|
I’m not entirely sure what you just said, but I’m really proud of you, and I celebrate your achievement.
![]() 06/15/2018 at 00:44 |
|
Even reworded for laymen my work is usually over people’s heads
Long and short of it; I make computers do the tedium. Making Excel spreadsheets and emailing them is tedious. So now computers do that for me
![]() 06/15/2018 at 11:57 |
|
I had a feeling it was a little more than writing scripts.