September 2003 Blog Posts
I hate testing triggers. It's a pain to figure out what's going on inside the code. Especially when you're dealing with the inserted and deleted tables. There are two great tricks I always forget. The first is the SQL Debugger built into Query Analyzer. Create a stored procedure to make the database change that fires the trigger. Call this procedure in the debugger and it will step through the procedure AND the trigger(s). The second trick is that Profiler can show you each statement inside a stored procedure that executes. And this also shows each statement that executes inside a...
I recently found an article comparing software development to the construction industry. Here's the response to a software developer who said he wanted to write software like people construct buildings:
I started to explain: "In software development, we are told we should manage our projects like construction projects, where a building is designed at the start, cost and schedule are predictable, and customers get what they expect."
Silence. "You're kidding, right?" "No, honest, that's what we're told."
Incredulity turns to laughter. The idea that programmers would want to manage projects like the construction industry strikes my classmates as ludicrous.
As I make changes to an application I'm reminded how ugly @@IDENTITY is. We're using triggers to add some rudimentary data synchronization to this application. The application inserts a record, we capture it in the trigger and go put a copy in the new table. Except that the trigger sets a new value for @@IDENTITY when it fires. So our quick changes that weren't going to affect anything are now much bigger than we planned. Rather than doing this all at the database level we now have to open up the application and touch that code too. Or find a...
The PASS conference is in Seattle from November 10-14, 2003. I'll be there and giving a talk on Profiler. They'll have a detailed preview of Yukon and you get a free copy of Windows 2003 Enterprise Edition. For half of that cluster in your basement. You'd think they'd give us SQL Server too. You can save $200 if you register by October 10th.
Welcome to the blogs at sqlteam.com!