Posts Tagged ‘T-SQL

Use a CTE to recursively roll up all descendant records into separate groups, regardless of level. Example data and Common Table Expression code included.

The 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.

I 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.

T-SQL query to report the row count of all tables in a database without the heavy I/O cost of a table scan.

Ever 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.


  • Kurt Hitchen: A friend has let me "see" there calendar in Google Calendar, but because their calendar is set to pr [...]
  • bugoy8: https://www.google.com/calendar/dav/nba_13_%4cos+%41ngeles+%4cakers#sports@group.v.calendar.google.c [...]
  • Speaker: Wasn't able to understand how to access the shared folder in the quest OS from this tutorial. Hmmm [...]
  • Elena Kuznetsova: I have killed an hour to figure out how to sync Google contacts' birthday and I have this done! U [...]
  • Andy: I have been trying to figure this out forever.....Thank you ever so much!! [...]


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States.