Recursive Common Table Expressions
Common Table Expressions are extremely helpful when you have a hierarchy of data. In our example below we have a table called OrganizationUnits that contains a representation of the Organizational Units in an Active Directory domain.
Removing time from SQL datetime
We use SQL server to store data—a lot. Sometimes we need to remove the time for a DATETIME column. This is useful for analysis or grouping by day. There is no built-in function that does this, so developers often write their own. I’ve written several, some of which are much faster than others.
Developer Tip Quickly look up table information in SQL Server Management Studio
You are working on a SQL query joining some tables when you need to know more about one of your tables … you could open another query window and run “sp_help tbUserGroup” OR you can just select the table and hit ALT F1 to do the same thing!
