Blog Post

T-SQL Tuesday 177: Managing database code

,

I am excited to host the T-SQL Tuesday blog party for August 2024. I’ve done this many times, but I always remember when I was new to the community and how much it helped me gain recognition. Thanks to Adam Machanic for starting this initiative and to Steve Jones for keeping it going.

This month’s topic is ‘Managing Database Code’. I initially called it ‘How do you manage your database repo?’, but Steve pointed out that many people in the database community might not know what a ‘repo’ is. So, we simplified it to ‘Managing Database Code’. Managing code has been a big part of my work as a database engineer for the past six years.

A repo, for those who are not aware, is just short for ‘repository‘, a place to store stuff. In this context, a place where ‘keep’ code. It is version control for code. I remember the days before repos were common. We used tools like VSS/TFS and searched through tickets and comments to track changes. We used DMV-based queries to find objects. Now, with repos, everything is much easier. I can’t imagine working without one.

I’m curious about how others manage their database code. Here are some questions to consider:

  1. Where do you keep your database code? Is it in a GIT-based repo, or just in the database the old-fashioned way?
  2. If it is in a repo, how is it created? Do you script out individual scripts and add them, or do you use tools to script out the entire database, like SSMS scripter, SMO-based scripts, or third-party tools? This could apply to any relational database, not just SQL Server.
  3. How do you keep your repo up to date when code changes? Depending on what your shop does, you may or may not have a well evolved CI/CD pipeline. If you do, explain how it works. If you don’t, that’s fine – we just want to know where the code resides, if it is outside the database.
  4. If you don’t have a repo, why not? How do you manage things like searching code or finding who made changes and when?

I look forward to reading your responses. The rules

  • Publish your post on Tuesday 13th of August , time zone does not matter.
  • Include the T-SQL Tuesday logo at the top of your post and link it back to this invitation post.
    • A comment letting me know you have a contribution is ideal but if that’s not doable, just send me an email!)
  • If you’re on X/Twitter, share your post using #tsql2sday.

If you want to know more, check out the T-SQL Tuesday Rules of Engagement.

Thank you!

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating