Technology Musings
Use a CTE to recursively roll up all descendant records into separate groups, regardless of level. Example data and Common Table Expression code included.
In: SQL Server
17 Feb 2009The DATETIME data type is often misunderstood and used inefficiently, forcing table scans with YEAR or MONTH functions. With the proper knowledge and tools, developers can more efficiently leverage the DATETIME data type and speed up slow-running queries.
In: SQL Server
2 Oct 2008I stumbled upon a few little gems that SQL Server 2008 includes that I hadn’t yet heard about. Although, very few are deploying SQL 2008 to production currently, these enhancements might make life programming in 2008 much easier.
In: SQL Server
1 Oct 2008T-SQL query to report the row count of all tables in a database without the heavy I/O cost of a table scan.
In: SQL Server
15 Aug 2008Ever needed to round an arbitrary DATETIME to some specified increment (i.e. 5, 10 or 15 minutes)? This function can come in handy for such a task.