At work, some years ago, I was able to implement a dba code review and practice deployment requirement for every Change Request. (A Change Request documents the proper steps have been taken so that a deployment has a good chance of success.) This was tough because my department loves project concurrency, added a ton of work for the dba team, and resulted in several conversations with developers who were pretty excited after hearing their sql required changes to comply with the published standards. Wow.
To help with the process, the I gave presentations and published the best practices standards document.The code review, in short, is to make sure obvious DDL such as foreign keys are present; comments exist; and performance has been given more than lip service.
Since the inception, I am glad to see that the developers, on their own, have instituted a peer code review. It has also been great to see how the developers have incorporated from our discussions the ideas and techniques into their sql.
We don’t have a great system for performance reviews and I’ve had a very difficult time getting attention to slow running sql. The management hasn’t been super excited and that is, frankly, a big hurdle.
Another issue is that only changes or new sql is legally review-able. I ask developers, “Would you want your next employer to know this is your sql?” because I personally believe if something is touched then the entire object should be brought up to the new standard.
Change is possible, right?