Database triggers are generally pretty awful. Anyone who has had to deal with a database heavily laden with DML triggers knows this and avoids using them. If anyone tells me that they must use a trigger, I can always prove that there’s a better way that doesn’t bury dependencies and business logic so deeply in the database.… Continue reading Schema Refactoring with Views
If you use frameworks like Microsoft Azure Mobile Services or Ruby on Rails, then you’re accustomed to complying with a host of development conventions. Frameworks are often said to be opinionated, forcing certain design decisions on the developers who use them. Given that very few software design choices are perfect in every situation, the value… Continue reading On Primary Key Names
Here are the slides and scripts from my Change Data Capture and Change Tracking Deep Dive talk that I’ve been delivering at various conferences and user groups recently. PowerPoint Presentation SQL Scripts The CT script depends on database setup steps in the CDC, by the way, so run through that one first.
A few years ago, I was working on a project where I needed to calculate the distance between pairs of points on the Earth’s surface. With a bit of research, I found an implementation of the haversine formula written in Python on John D. Cook’s Standalone Numerical Code site. Given a pair of latitude and… Continue reading Earth Surface Distance in T-SQL