Browse the archive

T-SQL

How to create date buckets in T-SQL

I was fiddling around with some data, looking at making a quick aging report. I probably should have reached for Power BI Desktop, but sometimes I can be stubborn, and I wanted to get my T-SQL to work–if nothing else to figure out how to make it work.

Continue reading

Why does ALTER let me DROP?

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 …

Continue reading

Year 4: May 2017 - May 2018

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 I was doing, and keep sharing what I …

Continue reading

Code to purge data based on creation date

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, …

Continue reading

The thrill of purging old data

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 …

Continue reading