Blocking with OBJECT_NAME()

December 24, 2019 Andy 0

As a DBA, you probably use the OBJECT_NAME() function quite a bit. I know I do. If you aren’t familiar with it, you can read the documentation if you want, but it’s a pretty straightforward function that converts object IDs into object names. I ran … [Read More]

Why does ALTER let me DROP?

August 28, 2019 Andy 3

I was recently chatting with a coworker, discussing why there is no discrete DROP permission for tables, procedures, etc. The conversation actually came from a #SQLHelp question on SQL Slack that was asked along the lines of “What if I want to let a user … [Read More]

Year 4: May 2017 – May 2018

May 21, 2019 Andy 0

In Year Three, I had a pretty big year. I kind of felt like I had peaked. I had received the Community Influencer of the Year Award and Microsoft MVP Award. Where do you go from there? Mostly, I just wanted to keep up what … [Read More]

Code to purge data based on creation date

April 4, 2019 Andy 6

Yesterday, I talked about batching deletes, and the day before I talked about how much I like to delete data, and why it’s necessary to do it, despite being a data pack rat. Today, let’s look at just one scenario, and how I like to handle it. In my experience, this is one of the most common purge requirements (and probably the easiest), so first, let’s look at the business requirements.

Purging data with batched deletes

April 3, 2019 Andy 2

Yesterday, I wrote about the importance of planning your data purges. Today, let’s look at the simplest requirement for purging data: Keep data for X days after it’s created.

The thrill of purging old data

April 2, 2019 Andy 0

DBAs & Data professionals tend to be digital packrats. My personal Google Drive is filled with random files that I refused to part with–even though it’s of questionable value. I lament that I do not have a copy of every paper I typed in high school or college–and I envy those who do. You never know when you’ll need notes from that meeting 6 years ago, or when you’ll need that funny GIF you created for an inside joke you no longer remember.

TSQL Tuesday #99: Tabs vs Spaces

February 13, 2018 Andy 3

The great tabs vs spaces debate is often framed as a matter of opinion or coding style. “As long as you’re consistent, it doesn’t matter.” Keep in mind that unlike your choice in footwear, coding style can’t be personal. I’m going to draw a line in the sand and say that tabs, like Crocs and mullets, are bad style.

Parsing file names from paths using T-SQL

January 17, 2018 Andy 15

SQL Server is great at a lot of things. I spend a lot of time blogging about all the cool things that SQL Server does. But (you knew there was a “but”, didn’t you) SQL Server isn’t great at everything. Lets write about something that … [Read More]