Categories
T-SQL Tuesday

T-SQL Tuesday #195 – How Has My Code Aged?

This month, Pat asks us to consider how our code has aged. Like fine wine, or old milk? A common time to revisit old code is when something breaks. I was contemplating Pat’s question this week when a field length change had caused a truncation issue in an old SSIS data flow. Some code doesn’t age […]

Categories
SQL

Why Do We Still Use RAISERROR?

I don’t use RAISERROR often – I usually forget which severity code to use. After looking at a sprinkling of them recently I decided it was time for a refresher, so come along for the ride. If you check out the online documentation it states that “New applications should use THROW instead”. It also sounds like its used to raise […]

Categories
SQL

Implementing Logging for Rollbacks

Last time out we looked at how data can be persisted even with a ROLLBACK being executed. Here we’re going to take that and look at an example of using it in action. We’ll generate some data – which may be good or bad – and try to add it to a table. If there’s any bad data […]