About Greg Moore

Founder and owner of Green Mountain Software, a consulting firm based in the Capital District of New York focusing on SQL Server. Consulting DBA ("and other duties as assigned") by day, and sometimes night, and caver by night (and sometimes day). When I'm not in front of a computer or with my family I'm often out hiking, biking, caving or teaching cave rescue skills.

It’s Not Their Responsibility

Imagine if you will, a friend tells you they found an unwelcome guest had been in their house. Not necessarily a burglar or anything like that, but simply someone who saw the door was unlocked, and decided to walk in, grab a cold one, pop it open and then put their feet up and start watching TV. Finally they finished watching TV and left. The only thing left behind was a note that said, “Hey, I noticed you had a really nice house, and a nice taste in beverages and your TV is really kick-ass. Hope you don’t mind me checking it out. I’d love to get to know you better and perhaps replace the cold one I drank. Thanks”

Your friend is understandably upset. They feel violated and they post their anger about it.

Now I want you to ask yourself, how would you react?

Would you tell them, “well you should lock your door?” That may seem like good advice, but I suspect your friend has already thought about it. And perhaps they had good reason to leave the door unlocked (perhaps they were just out for a bit and expecting an actual welcome guest to pop in?) In any case, probably not the most useful advice and in a sense is putting the burden on your friend.

Would you commensurate with? Give them a hug and tell them how you sympathize and how you share their concerns? I’d hope so. Your friend has just shared something traumatic with you. They are most likely looking for some comfort.

Would you suggest to your friend that perhaps they should figure out who this person is and take the time to tell them that going into people’s houses uninvited is not a good idea? Let’s ignore the difficulty of figuring out who the person is (perhaps they left their address in hopes your friend would contact them). I would certainly hope you would not do this. First of all, it’s not your friend’s responsibility to tell a complete stranger how to behave. Secondly, you’re now putting the pressure on the victim here and potentially adding to their trauma. There really is no upside to this approach. Just DO NOT DO THIS!

Now, imagine it’s the complete stranger is actually your friend who did this. You hear their story of how they basically played Goldilocks for a day in someone else’s house. This time, ask yourself the question, would you expect the home owner to tell them what they did was wrong or would you think perhaps you as a friend should point out how egregious their behavior was. This is where your focus should be. Making sure the people around you don’t do this. Not telling the homeowners to give this lesson.

To whose who are saying “well the above is a made up scenario” you’re right. It is.

But replace the house and the cold one and the TV with an unsolicited email via a professional site like LinkedIn. It’s the same effect.

Let’s play a little game here. You may recall it from Sesame Street. It’s called “One of these things is not like the other.”

  • Grindr
  • Tinder
  • LinkedIn
  • Adult Friend Finder

Or another

  • SQL Saturday
  • Local User Group Meeting
  • Your local Singles Group

In the first case, one of those sites is definitely not a place to try to hit on people. It’s a professional site to maintain professional contacts. The other sites are designed to find dates

In the second case, one of those places is definitely a place appropriate place to try to hit on someone. The other two, not so much.

If you can’t tell the difference, my advice, stay away from all of the above until you can.

The take-away: Don’t put the burden for teaching proper behavior on the subject. Take it on yourself and make sure you don’t know anyone who would presume to use a professional site in such an unprofessional manner.

This post may or may not have been inspired by true events. Does it matter?

T-SQL Tuesday

I wasn’t sure what I was going to write about today and then saw it was T-SQL Tuesday, this month’s question from Kenneth Fisher. The topic is “Your First Technical Job”.

I had to actually stop and think about this one for a second. The requirement was to not talk about ones first DBA job, but ones first technical job.

I entered RPI, my alma mater in the fall of 1985. This means I should have graduated in 1989. However, I graduated in 1990 and that made all the difference in my career. One thing that RPI had then, and still has, is a very robust Co-Op program. These were (and I believe still are) an opportunity to work for a company in your field for a summer and at least one semester. Unlike some college programs like this, RPI’s Co-Op office made sure that you were doing actual work in your field, not relegated to say filing papers in an office, or getting coffee for the full-time employees. You also were paid, just like an employee. Given my financial status as a student, this was a huge help.

Through a series of connections, I found myself working at company in Troy called Laboratory MicroSystems. It’s long gone, but it was a good company. It was founded by a pair of RPI alumns, one of which who had also been an Outing Club member and for awhile, tended to hire Outing Club members. It was our own networking group.

That said, my housemate and best friend had just completed his Co-Op there, so there was an opening. After a quick interview, I was hired and started working a few weeks later.

Let me say that this was a great opportunity for me. I had learned a lot in the classroom (even if my grades didn’t always show it!) But, I had never actually applied such skills in the real world. And to further complicate things, my manager was on vacation my first week. Not only was I thrown into the deep end, I didn’t even have a lifeguard.

My friend, when he was there, had taken the PC version of a package they had, called Thermal Analysis and ported it over to a mini-computer (I believe some sort of HP model). To give you an idea of how long ago this was, all the work was done in Fortran.

My job ironically enough, was to take the HP version of the software, that now had been updated and improved and back-port it BACK to the PC. Up until now all my projects in school had been 1, maybe 2 files. So any linking (yeah kids these days are wondering what I mean there) could be done by hand and I had never created a make file. (go google it kids). So very quickly in my first week I learned how to actually compile and link large groups of files in a complex, real-world environment.

Within a few weeks I was deep into the code and really starting to understand how it worked and how to apply my classroom skills. It was a great experience. After about 8 months on the job, it was time to go back to the classroom. But I wasn’t through yet. After another semester of school, I went back for another Co-Op and worked another semester and summer. At this point my manager had moved onto another company and the rest of the company moved onto a new product and project (one that ultimately made the company valuable enough to be sold and for the founders to move on.) I found myself in an unusual position of being 20 years old and the lead developer on a product with no other teammates other than a 20 something sales manager who spent more time on the phone talking about his supposed sexual exploits than actually make sales. But he’s a story for another time.

During this time there are several things that stand out as I think greatly helping me in my career.

The first was adding pop-up help to the Thermal Analysis program. One has to remember, this was back in the days of purely DOS programs, so one normally didn’t have overlapping windows, and the like. But a few customers had wanted some sort of help system added. It took some work, but I finally found a way to do it. Fortran was great for the computational aspects and the 3rd party library helped us display plots on the screen. However, Fortran wasn’t great for developing a UI. After reading and research, I realized I could do what I wanted with some C and Assembler code. This is also when I learned that their call stacks were reversed from Fortran. So I ended up having Fortran calling C code, using a keyword Pascal to ensure the stack would read in the right direction (don’t ask me why it used that for the keyword) and then the C code called ASM to call the DOS interrupts to allow a pop-up to be displayed, and then the C code populated the pop-up with the help text. Learning how to do this, really helped me with my problem solving skills and to learn that “solutions exist” it’s just a matter of finding them.

Another project was one completely unrelated to Thermal Analysis. I can’t recall the name we gave the problem, but it was software we wrote for GE Plastics that basically involved setting up a material on a tensile test machine (a machine that would pull stuff apart at whatever speed you told it to. In this case, the test took a year to run!) GE had provided the hardware and the hardware specific language to write this in and I was off. This had to handle reboots, power outages and the like. Fortunately we were using an external A/D (analog/digital) converter box made by Perkin-Elmer that could store a certain number of data points. This meant we could reboot the PC and reread in data to see if it were new or not. The software was the first I’d seen that had any sort of try/catch (though I believe they called it something else). So I was able to learn and develop good error-handling techniques. Something I’m still working on and improving on to this day.

But, ultimately, this job really led me to where I am today through a convoluted series of steps. The office network was Novell Server with Thinwire ethernet. For those who don’t recall what Thinwire is (or was) the key details was that rather than every network cable running back to a central switch, the cable ran in a serial line from computer to computer and any break in it resulted in a network outage. There were many ways this could fail.

Well between my software work, I started to be the go-to guy for diagnosing network issues. And then for issues with the Novell Server itself.

After college, for various reasons (including I suspect because both my parents had worked for themselves) I wasn’t eager to work for another company right away. So I went into consulting and my first client was, you guessed it, Laboratory MicroSystems. I started handling all their IT needs, which continued to grow. When I had started, they barely filled one floor of the building they were in. By now they were spread across 3 floors and still growing.

And that product everyone else had started working on during my Co-Op? Well by now they were porting it to use SQL Server 4.21a, and they realized that they could use a specialist to go to customer sites and install SQL Server before they sent out their specialists to install the actual software.

And that folks is how, I started out programming in Fortran and ended up as a SQL Server DBA.

Someday, I’ll tell you how the Streets of Laredo figures into this story or how the last I had heard about the now formal sales manager involved him and a radio contest or even how after I stopped consulting I did one last gig for them as a 1 day Oracle consultant or the time I saved them (after being bought) from moving into a new office with only 2 outlets for 24 people.

But in the meantime, now back to studying for a test for my next change of career to hopefully become a Physicians Assistant!

Learning the Lingo

“Now, in the ’60s, there were only two other cars made in America that had Positraction, and independent rear suspension, and enough power to make these marks.” – Mona Lisa Vito

In my first stint as a computer consultant, I was visiting a potential client and noticed a magazine called I believe The American Bee Journal. I was a little surprised at first that such a magazine even existed, but then it dawned on me that it made perfect sense and that probably every specialty had a trade magazine or the like of its own.

In the world of SQL Server we’ll talk about query plans and clustered indexes vs non-clustered indexes and use other words specific to our trade.

In caving we’ll talk about speleothems and karst and other words that the average person might not recognize.

And mechanics can talk about Positraction and skid marks.

Knowing the language of a particular specialty can be important when it comes to understanding it.

I’ve been reflecting upon this lately as I continue to study so I can apply to a Physician’s Assistant program. I’m about to finish up my first semester of classes and one of the classes I’ve been taking and really enjoying is Anatomy and Physiology I. I still have a second class to take, but I’ve been loving things so far. It is, to me, absolutely fascinating to learn how the body works. For example, learning the physiology of muscle contractions is in three words, absolutely fucking cool. And any caver who has vertical experience would realize it’s not much different from how we ascend a rope.

Part of what I’m learning to is the language. In fact one of the first lectures and labs was simply on the language to use describe where things are. To someone not familiar with the language, it may sound like gibberish to say that the tibia is lateral to the fibula and the lateral malleolus is at the distal end, but such a description can help someone who knows the language orient themselves as to its location. Similarly if someone says they have a sore sternocleidomastoid muscle, I’d know where it is, based simply on the name. (I’d also honestly wonder why they simply didn’t say they had a sore muscle in their neck). In that case, the name of the muscle basically describes its origin (the sternum and clavicle or cleido) and insertion (the mastoid process). (If you’re curious, if you turn your head to the left, you can see the right sternocleidomastoid sort of bulging from the right side of your neck).

Honestly, at times I feel like I’m at a Broadway play and the orchestra is playing the overture and the curtain is slowly being drawn back to reveal what’s behind it. I’m excited by what I’ve learned and seen so far and excited to see what more I’ll see as the curtain continues to be drawn back!

Woody Woodpecker

There’s an old saying in the software industry that “If houses were built like software was, the first woodpecker that came along would destroy civilization.”

I was reminded of that last week in both ways. First I was sitting at my desk when I heard what sounded like someone banging on a tin drum of some sort. I went up to the porch outside my office window and saw a bird fly off. Seeing that only solved part of the question in my mind and created a new one. The new one was what the heck was a woodpecker doing on the corner post. It’s pressure-treated and there’s no signs of any sort of infestation. But even more so, why was it so friggen’ loud and metal sounding? About 20 minutes later it was back. I chased it off again.

This cycle has become a daily event with it coming back 3-4 times a day. But I finally got a partial answer. I had forgotten that on the far side of the post was the copper downspout for the gutters. As far as I can tell, it’s hitting it directly (though I can’t imagine why) or close enough that the entire downspout is acting like a drum. Annoys the heck out of me, but the woodpecker doesn’t seem to care. And the good news is, despite all this, my house is still standing.

The other reminder was an error message I had received from an ETL process I have written for a customer. It takes data from a vendor and loads it into my client’s Salesforce instance. The error was one I hadn’t seen before (but had thankfully planned for). So I went into the package and started to investigate. It seemed all the new records had simply failed to load. I looked closely and could not see an issue, so I attempted a manual load and it instantly failed. This was unusual and troubling. My first thought was that the vendor had somehow changed the data format and that was causing a problem, but nothing really indicated that (and had that happened it most likely would have actually generated an error earlier in the process).

After some digging I realized that it wasn’t the vendors fault. As part of the ETL process, one of the steps that happens is a lookup into Salesforce for a Vendor ID to make sure the data coming in is tagged with the right ID. This step is somewhat important because the ID, being an internally generated one in Salesforce, is different between the UAT instance and the Prod instance, so rather than hardcoding it, it’s a lookup. And while the ID itself in an instance can never change, the keyword associated with it in theory can. In practice it shouldn’t. Normal users don’t have permission and admin users should know that changing the keyword should never be done, or if it is, needs an entire change process.

Sure enough, my lookup, which was basically doing “Where Vendor_ID=’Adventureworks'” was now returning nothing. So the insert, which needs that Vendor_ID was failing. A little digging showed that an admin had changed it and not to something like ‘Adventure Works’ or something that might have been close and thought to be a trivial example, but had changed it to something like ‘Bob and Mary’. It wasn’t even close.

Needless to say, better controls have been put into place, but apparently a woodpecker came along and broke my ETL.

Fortunately, that one isn’t coming back.

Code strong, code robustly, and have good error checking.

An Ode to my Mom

Three-quarters of a century. That time frame seems both like forever and a blink of an eye. They say one doesn’t speak of the age of a lady, but I think in this case, I’ll make an exception. This past weekend, besides celebrating Easter a day early, my family and I celebrated my mother’s 75th birthday.

Now when one thinks of an Easter celebration, one might think of a ham or lamb dinner with all the trimmings, or at the very least some sort of formal sit-down meal. And yes, for much of my life that’s what we had, especially when we would celebrate at my grandmother’s.

But no, this year my mom, now the matriarch of at least this little corner of the family decided she’d rather do take-out sushi and loads of Thai food from a local restaurant. And a great repast it was.

That’s not to say we eschewed all tradition. Ever since my kids, her only grandchildren have been old enough, she and her partner Jimmy have hidden plastic Easter eggs around their house for the kids to find. Even at 22 and just about 19, they still enjoy the tradition and while being quite competitive about it, end up sharing the rewards equally. And inevitably there’s one plastic egg that seems to go missing.

This year, that tradition was changed a bit to accommodate my cousin’s children who are much younger. For them, the eggs were multi-colored and placed on the floor. And yet, they still managed to find a few of the ones higher up. I suppose a child’s reach should exceed their grasp.

And of course, as always in our family there was the tradition of cracking colored, boiled eggs.

Easter Eggs, ripe for cracking

But as I mentioned it wasn’t just an Easter celebration, it was a celebration of 75 years of my mother’s life travelling around the Sun. Of course I wasn’t around for some of those years, but I know she’s always been the unconventional one in the family. She’s the one that went to art school, the first to get married, the first to get divorced. She was the one that opened a store for interior design in a small town in Northwest Connecticut. She later managed one of the first antique centers in the area. While she may not have had the formal education of some of her peers, but she often could out smart them anyway.

During college, I’d often stop by after a hiking trip with friends in tow, and no matter how many, she somehow always had food in the house to feed them all, no matter how muddy or stinky we might be. I even managed to get her into a couple of caves one time.

Other times I’d come home from college for vacation or break and we’d end up in deep philosophical discussions or discussions about politics. We still do from time to time, though now, more often on the phone.

She’s taught me much of my appreciation for music, and I will never think of Joni Mitchell or Billie Holiday without her. And my kids will always have memories of sitting on the floor eating sushi with her. You might start to notice a theme here that involves food. I will add “wavy pizza” without any context.

I think I should add at this point that my mom is, in my opinion an awesome cook and I developed my love of cooking and baking from her.

All these memories and many more have been running through my head over the past few days. 75 seems like a magical number and I think it is. And the truth is, given the events of Covid over the past few years, this honestly was perhaps the best Easter and birthday I recall in awhile. I’m glad I was able to celebrate it with her and look forward to many more.

And while as she admit, her body is showing her age a bit, her spirit hasn’t slowed down one wit and I love her for that.

And Mom, I look forward to celebrating number 76 and many more with you. In the meantime, don’t trip over the robo-vac and enjoy all the flowers and so much more in your life.

Up a Creek…

Actually more like an upstream problem. Or two.

Or, another week in the life of a DBA and other duties as assigned

So a few weeks ago a developer at a client of mine reported that some recently deployed code wasn’t working. I tried it and of course it worked for me. That isn’t unusual since I have sysadmin rights on that box. I tried execute as using her ID and it failed. Not uncommon, sometimes in production permissions don’t get promoted the way they should. So I checked her permissions and the permissions of the users actively trying to call the stored procedure. Strangely, they all had the proper permissions, at least as far as I could tell. Then I had that lightbulb insight and realized I had been misinterpreting the error message execute as was giving me. “The server principle “DOMAIN\USerXYZ” is not able to access the database “ImportantDB” under the current security context.”

I realized I had been troubleshooting the wrong problem. It wasn’t that the person didn’t have permissions to execute, it was that no one other than sysadmins had the right to CONNECT to the database. A simple:

GRANT CONNECT SQL

And all was good to go! Or was it? It took us some digging to figure out why this had happened on a production database. Apparently when the database was designed in Dev, the developers had the rights they need to connect, so never thought about who else might need to connect. Apparently they had created it with very limited Grant Connect rights. When the database was moved to production, in this case, with a backup and restore the same lack of rights moved upstream with it.

Now, in the opposite direction, a vendor wanted to send a file to my client in their UAT environment. I fired up the PowerShell script to retrieve the file and decrypt it. The decryption failed. It took me awhile to figure out the problem. The client has a rule that every 2 years we must upgrade our RSA Public Key with them. Ironically, I had just completed the most recent update last month and moved it into production. Apparently though, their rule doesn’t apply to their UAT environment. Which came as sort of a shock to me, since they’re always so insistent on us following their security requirements. Of course beyond the irony of them not following their own rules, the file they had asked we download, wasn’t there.

The PM contacted them and they assured him the file would be there on Friday. Well here it is Tuesday and we’ll see if this time the file is there.

In any case, this time, the problem wasn’t promoting a change from UAT to PROD, but the client’s failure to move a change from PROD to UAT.

Such is life.

So sometimes I’m the creek without the paddle and sometimes I’m down the creek…

Unlocking the Secrets of the Universe, or at least Databases and Muscles

I think I speak for many DBAs when they say they’ve all had a programmer tell them, “The database is too slow, we need faster hardware.” Then as a DBA, you go in, look at their query and realize they’re running a table scan across a huge 100GB plus table without any indices. You analyze the data and overall usage further and decide to put in an index and suddenly their query is running in sub-second times instead of minutes.

Or, in a case I was working with with a client years ago, they had a stored procedure that sometimes would suddenly get slow. Their solution was to occasionally issue a WITH RECOMPILE command when calling it and things would get better. It worked, but was hardly ideal. After analyzing the stored procedure and usage I realized that it was suffering from a form of parameter sniffing and with a bit of work I was able to recommend a rewrite that solved their problem in a better way.

What is critical here is understanding HOW exactly data is stored and how the query engine works and how we can take advantage of how the database engine works to improve things.

And honestly, for me, I’ve always loved understanding “how things work.” I’ve marveled at seeing Bob Ward open up the debugger, live on stage, and show how a particular piece of code in the SQL engine works.

And now, I’m starting to undergo the same journey in the human body.

Let me caveat things by saying I am only half-way through my Anatomy & Physiology I class (and same with my Bio I class) and I greatly recognize how much more I have yet to learn (and that’s only out of what we know. We’re still learning more!)

However, I continue to be blown away with “how things work.” Mother Nature has had millions and millions of years to make things work. What strikes me as interesting at times is how both conservative and ingenious things can be. We all start from a single cell that divides and forms a sphere of cells. This soon forms a neural tube and then starts to specialize further. Somehow from that single cell we end up with our feet at one end and our skull at the other, completely different, but from the same source.

But, even then when you dig deeper you realize that at some level hands are really feet, but with an opposable joint and far more flexibility and dexterity. The internal structures are very similar. Then you move up to the arms and legs and realize even the limbs start out fairly similar: the upper limb has a single main bone and the lower limb has two bones. Of course the joints start to differ, a knee joint is VERY different from an elbow joint. Nature is conservative.

This week we started to study skeletal muscles and how they work. This builds on earlier lessons in both the parts of a cell and histology. A generic animal cell has sort of a skeleton made up of fibers the cell produces. These fibers can come in one of several forms. In most cases they’re simply there to give a certain structure to the cell, or perhaps via the use of other proteins, connect to other cells. They often may look haphazard in design and function, but they get the job done.

Until you look at skeletal muscle. Then you see two of the fibers are laid out a bit differently. One, the thin “actin” fibers are laid out radially around larger fibers, the myosin. You may see these fibers in other cells, but in muscle cells their layout is different. And this makes all the difference. The myosin fibers have “heads” on them that can, in the right circumstances both attach to the actin fiber, but also essentially pull on it by flipping its head from a “forward” to a “backwards” position. The head can then release, flop back to its original position, grab the actin again, and again flip back to the tail facing position. I’ve left out a lot of details, but if you think of yourself using both hands to pull upon a rope, you get the same basic idea. Or, for the caving readers among me, it’s a pair of handled ascenders and it’s basically using a Texas system!

To me, this is really an ingenious re-use of existing structures inside the cell. The more I learn about the human body (or biology in general) the more I’m amazed.

I’m loving “seeing under the covers” and this is part of it!

This Week In School

From the first day of classes I’ve worried about a week like this. I think I’ve mentioned I’m only taking three of the prereqs I need to apply to PA school. That’s not a horribly heavy load, but this week everything came to a head at once.

  • Monday – Anatomy & Physiology I Exam
  • Tuesday – Bio I Exam
  • Wednesday – Bio Prelab due and Bio Lab Quiz
  • Saturday – General Psych Exam Due
  • Sunday – General Psych Paper Due

Literally the only thing that’s NOT happening this week is my A&P lab quiz on bones and their facets and attachments points and more. I suppose I should be grateful for small favors.

And to make things worse, none of my study group for A&P was available this weekend.

Now fortunately, the General Psych paper can be submitted for review early, so I knocked that out Saturday morning and got feedback by Sunday night. So I’ll upload that shortly. And the General Psych test is online and available starting tomorrow night, so I can put off studying for that a bit and take it at my convenience.

And finally, the Bio Prelab is almost literally cut and paste and can be submitted on-line. So that’s been knocked out.

But the A&P I and Bio I exams: those made me nervous. Fortunately they’re mostly multiple choice, with the Bio exam having some essay questions.

I’ve always been a decent test taker, but I have to admit, multiple choice does make things easier. In fact, one of the topics we covered in General Psych last week is memory and how recognition is “easier” than recall. i.e. it’s a bit easier to see 4 possible answers to a question and recognize the right one than to be simply asked the question and have to recall the information and write it down.

That said, for me, one thing I often like to do when taking a multiple choice test is see if I can think of the right answer before I actually see the choices, i.e. make use of recall to reinforce my recognition. This gives me more confidence when I eventually choose my final answer.

And if you add to this the fact that there are actually skills one can learn when taking multiple choice tests, such as recognizing distractors, knowing certain answers are simply wrong and sometimes being able to think through to the right answer.

This came into play on question on yesterday’s test. I went back and checked all my answers before handing in the Scantron (yes, they still use them!) and had marked a few for “definitely look at” and one I wasn’t 100% sure on. But I was able to rule out two answers of the 4 and was down to two answers. I had initially checked one of them, but the more I thought about it, the more I realized the other was the right one.

So, one test down, another in an hour and then on to the rest. Wish me luck.

… Other Duties as Assigned #2 in a series

I wrote last year about how my job title seems to be DBA and other Duties as assigned. A little incident yesterday got me thinking about that again. This time though, it got me thinking more about the DBA side of that title.

I’ve mentioned before I’ve written a number of ETLs for various clients. Some are fairly complex and some are fairly simply PowerShell scripts. In most cases, at the end of the script I send an email with a success or failure status and some additional information if appropriate.

Over the last two weeks I had noticed that the email for one particular ETL was coming in later and later. I finally found somet time to investigate. I looked at the destination table and noticed that some of the tables had extremely large numbers of rows. Now, my first inclination was that the source data had increased (which would be a good thing, it meant the client was basically selling more widgets). But the increase seemed too dramatic and large. My next thought was perhaps the export itself was simply giving me more data.

So I decided to look more closely at the data and I noticed something interesting. Picking on of the tables at random, I simply did a

select * from RandomTable order by GoodIndex

SSMS returned approximately 24,000 rows. But something stood out. There appeared to be duplicates rows. Lots of them. This raised a lot of suspicions.

I then ran the query on my UAT box which in this case actually loads a copy of the production data. I got back about 1,600 rows. VERY curious.

Back on production now I ran

select distinct * from RandomTable order by GoodIndex

This time I got back the same number as UAT. Extremely curious.

Then it dawned on me, about 2 weeks ago, we had made a change to where the script looked for the source data, a number of CSV files. UAT had not changed, but Prod had. The reason for this change was to be able to get the ETL PowerShell script to run on the proper production server (the original location had security issues reading from the original CSV file location.)

So my first thought was that the team that had updated their export had somehow left out the command to delete the old file and was simply appending. I was about to write a pointed email when I stopped myself.

I looked at my code and realized that when I had setup the script on the new production box, I had properly handled all the permissions except one: the step that truncated the destination table. Sure enough, my code was no longer truncating the table before I inserted new information. Fortunately I realized my mistake before sending that pointed email.

So was this a DBA issue or a “other duties as assigned” issue? I don’t know, but I’d say as a DBA I should have not created the problem in the first place, but thankfully, due to proper logging and emails I was able to catch it and solve it fairly quickly.

Moral of the story: Pay attention to details. Notice when things start to drift. They can be the sign of a larger issue.

SQLBits – My Thoughts

Many weeks I struggle with what I plan on writing about, but this post came to me last Thursday or Friday. It was clear to me that I should write about 2022 SQLBits.

Now, the more astute of you are probably thinking, “But Greg, you weren’t there. How can you write about it?”

Well you’re right. I’m not going to write about my experience attending it. Rather I’m going to write about my experience not attending it.

I had applied to speak at SQLBits, but didn’t make the cut this year. That happens. But this time there was more than mixed feelings. Had I been selected, I almost certainly would have tried to find a way to do so in person. However, as many of my readers know, I’m back in school taking classes as prereqs to get into PA school. And frankly, I’m loving it. But it is taking time and focus. This week, March 14-18 is Spring break for my fellow students. But last week I did have classes and I’m not sure I could have taken the time off to fly to the UK. And I’m not sure I would have wanted to; if only because of missing my A&P I lab this week (learning about the bones of the head and spine, including the axis and atlas (C1, C2 vertebrae).

So in a sense, I’m almost grateful that I wasn’t chosen to speak. It solved me the pain of trying to solve the dilemma of do I attend in person or not?

But dang, did I miss people. I saw posts from so many of my #SQLFamily that I was sad I couldn’t see them in person. And then, looking at the calendar, it dawned on me, I’m not entirely sure I can make the PASS Summit this year, again due to classes.

It just drove home how much so many of you have become family and how much I miss so many of you. And in some ways its just the start. As my plans continue, I’ll find myself making the slow transition from the #SQLFamily to hopefully a #PAFamily or whatever community I find there. And while I have often found myself in many communities, for example besides #SQLFamily I’m also heavily involved with the NCRC and plan on continuing my efforts there, I know over time my active involvement in #SQLFamily will slowly diminish. That said, I’m not walking away just yet and will continue to be involved as much as I can, both in presenting when I can and in running my local user group.

But that said, I miss you all. And do look forward to seeing any of you when I can.