logo

Modern SQL Style Guide

Modern SQL Style Guide - rev 1.0.1 A guide to writing clean, clear, and consistent SQL. select * from modern.sql_style_guide as guide where guide.attributes in ('clean', 'clear', 'consistent') and guide.look = 'beautiful' Purpose These guidelines are designed to make SQL statements easy to write, easy to read, easy to maintain, and beautiful to see. This document is to be used as a guide for anyone who would like to codify a team’s preferred SQL style.
17 minutes to read

String or binary data would be truncated

This, in my opinion, is the most frustrating error you can get in SQL Server. It’s the error you get when you’re trying to do an "INSERT INTO (…) SELECT (…)" to push a bunch of records from a query result into a table. If one of your (n)varchar fields is too small to hold one of the values, you get this lovely error. It’s nice that SQL Server won’t truncate your fields for you, but frustrating that you get this sad little error with no details.
3 minutes to read

Embedded Resources

In the .NET world, ORMs are only just now beginning to see the light of day. Though nHibernate has been around for awhile, it has not seen much uptake from mainstream .NET devs. It may have to do with typical FUD stuff, like its roots in the Java world, its reliance on XML for the mappings, its learning curve, or the lack of books and beginner’s resources. I’m not judging - I’ve read this book and I think nHibernate’s offerings are the most mature and robust available for .
4 minutes to read