Posted in SQL Server, T-SQL Tuesday

Dear 20-Year-Old Me (T-SQL Tuesday #115)

Dear 20-Year-Old Deborah,

Hi there! Yep, you’re doing that thing – you’re writing that letter to your 20-year-old self. But you’re doing it as part of a good cause. There’s this thing called T-SQL Tuesday, which is a monthly blog party in the SQL Server community where someone brings up a topic and everyone blogs about it. This letter is in response to Mohammad Darab (b|t), who is hosting this month. (Thanks for hosting, Mohammad!) He’s the one who had the topic of writing your 20-year old self. You can read all about it on his blog if you want to know more.

So this means a couple of things. First, you have a blog! You don’t write posts as often as you want. But think about it – with your love of books and wanting to know more about editing and publishing, it’s kind of up your alley.

The second part is that you’ve taken an unexpected turn careerwise. You know how you want nothing to do with math and science right now? Surprise! You’re a techie working with databases – Microsoft SQL Server to be specific. You work with computers. Go math & science! The funnier thing is summer temp job you had last year pulling data into ACT! in order to create mail marketing campaigns actually was the start of what your career turns out to be. Who knew?

Before you panic that you are wasting your time studying English and History and try to remember where the COSI department is, just stop. What you love about bringing those two subjects together is the same thing that you love about working with databases and working with the programmers on their applications. You love understanding and seeing the history and how it affects the literature and your understanding of it. With databases, it’s understanding the context of data in the larger picture of what’s going on around it. And you still manage to find ways to bring your love of English and history into what you’re doing – from the idea of a project for your blog to how you pull together your presentations.

Mohammad asked that we give some advice or words of encouragement. So here’s what I have for you – not just in your career but in everything you decide to pursue:

  • First, trust yourself. You have really good instincts so listen to them.
  • Second, it’s OK to have ambitions. You’re very aware of wanting to give everyone a fair shake, which is a good thing. You will also invest yourself in the projects that you work on and take ownership and pride in your work. But you have things you want to do as well. Remember not to let being fair to everyone or your commitment to a project or two mean that you put yourself on hold or lock yourself in a position where you can’t move forward.
  • Third, you have permission to act on your instincts and ambitions. There are all sorts of articles that talk about how women wait for permission to move ahead or take risks or ask for projects, etc. So we end up holding ourselves back because someone else will come along and take them without asking or waiting. Looking back, I know that you will do this along the way in your life. So I want to give you permission not only to be trust your instincts and have ambition, but to use them and move yourself forward. Find your opportunities or make them yourself. Most importantly, don’t be scared to go after what you want.

Even as I give this advice, I can’t tell you that it’s still easier said than done. It’s still something I’m trying to do, which is why I think it’s worthwhile and why I want to pass it on.

At 20 years old, I don’t know if we ever really have an idea of how life will go or even where we want it to go. Some people knew they wanted to go to law school or med school or graduate school but that was never you. And that’s OK. This career as a database profession just finds you and it really suits you.

I don’t want to tell you too much of what’s happens between now and then. (You saw Back to the Future, you know what happens.) But you don’t have to worry because things fall into place. Enjoy the journey you’re on.

Love, Not 20-Year-Old Deborah

TSQL2SDAY-150x150

Advertisements
Posted in SQL Server

#TIL About Foreign Key Scripts

No matter how long you work with something, you can always find something that you never knew before. I found one about foreign keys this week.

I was reviewing SQL scripts for coworkers and I noticed that the foreign keys were written without referencing the parent table’s column. But the script didn’t fail and created the foreign keys correctly. So how did this work?

Continue reading “#TIL About Foreign Key Scripts”

Posted in SQL Server, T-SQL Tuesday

T-SQL Tuesday #110 – Automate all the things

TSQL2SDAY-150x150I’m getting the new year started by joining in the T-SQL Tuesday party. Thanks to Garry Bargsley (b | t) for hosting this month’s topic: Automate All the Things.

What stuck out most to me is when Garry asked the question:

What does “Automate All the Things” mean to you?

It’s not the real focus of what he’s asking us to talk about it, but I think it’s important to talk about. When I think of automation, I think of setting up routines that need to occur on a regular schedule. This means that you would automate system checks, backups, maintenance, etc. that run every night. In some ways, I see automation as a tool that helps with mainly administrative tasks.

Well I don’t work on the administrative side of the house. I work in development so I don’t have to deal with the day-to-day maintenance work that benefits from automation. Now, I do see automation used in other places in development – for example, unit tests that run every time a build is kicked off, QA automation tests, etc. I know database work can have unit tests but it’s somehow hasn’t filter down to the way that I have worked. (Yet.)

However, I have started to recognize when I have to do a series of steps over and over for a reason – usually involving resetting my environment for testing one thing or another. I’ve started collecting the small pieces together and started creating mini scripts so I can do these steps again. And I’ve started modifying them so I can make them work in any situation. For example, I need to move data between two databases but the database names may be different so I added a parameter and made the statements dynamic so I just need to supply the right database names. Or I created a simple PowerShell that has the list of commands to run to do those few steps instead of me doing them separately each time. It’s not always a lot of steps but this way I don’t accidentally mistype something or put something in the wrong place.

In many ways, this is part of setting up automation – identifying the repeatable actions and creating a mechanism to repeat those steps in a reliable way so I know every time I run the script, each action will work correctly. While I’m not scheduling them to run at a certain time – whether it’s a calendar or from some other action, it’s laying the foundation so that if I – or my coworkers – could ever automate these actions, the basic set of scripts is ready to go.

Most of my database work is still done using T-SQL scripts. Call me old-fashioned but I like using these scripts because I can use them directly in a query window in Management Studio or I can call them from PowerShell and I know I’m doing the same exact actions regardless of how I execute the script. I’ve started to use PowerShell more to run these scripts. I still feel like I’m learning PowerShell, but I’m definitely getting more comfortable and improving my skills. None of this may be the cutting edge technology but it gets the job done.

One day, I’ll probably be able to implement what I consider to be true automation. Who knows – maybe someone else will consider what I’m doing “true automation.” But until I can really automate these actions, being able to set things up so that will be possible will have to do.

 

 

Posted in data modeling, SQL Server

How I Really Feel about Surrogate Primary Keys

When someone goes on a rant about something they truly feel strongly about – good or bad, my typical joking response is “You’re being a little wishy-washy about this. Tell me how you really feel.” I recently had a conversation with co-workers about surrogate primary keys and realized I need to use that line on myself.

So let me tell you how I really feel about surrogate primary keys. Where’s my soapbox?

soapbox

Continue reading “How I Really Feel about Surrogate Primary Keys”

Posted in SQL Server, T-SQL Tuesday

T-SQL Tuesday #105 – Brick Walls

TSQL2SDAY-150x150It’s another T-SQL Tuesday. Thanks to Wayne Sheffield (b|t) for hosting this month. His T-SQL Tuesday challenge is to write about Brick Walls we have faced. (If you are unfamiliar with the T-SQL Tuesday party, check out the website for the full backstory.)

It took me a bit to figure out what to write about for this topic. But that’s not the type of brick wall I want to post about today.

The Brick Wall:

I was working with a highly transactional system. The table with the most writes was also the table with the most reads. To add to the problem, the data being updated the most was the same data we need to read the most. The next set of popular tables, i.e. the next most read and updated tables, had triggers that used the most popular table for some of the data needed. As you can guess, we had a lot of deadlocks in our system. Oh, did I mention that this was running SQL Server 2000?

Continue reading “T-SQL Tuesday #105 – Brick Walls”