TSQL

There are 3 entries for the tag TSQL
SQL Server JOIN conditions

Every time I write a SQL statement that has a JOIN like this... 1: SELECT * 2: FROM Products 3: INNER JOIN Categories ON Categories.category_id = Products.category_id I wonder why I can't just write it like this... 1: SELECT * 2:...

posted @ Thursday, January 24, 2008 12:15 AM | Feedback (0)

SQL Server Enhancement Idea - Inactive records

About a year ago, I had an idea for a SQL Server enhancement that I never wrote about.  I crafted a few sample queries that would utilize the feature, and I shared them with some colleagues, but I never wrote an article about it.  Needless to say, it's been in the back of my head ever since, as an "unfinished task." One problem that almost all of us face is dealing with inactive database records.  There are dozens of approaches out there, but a few are becoming pretty standard.  Personally, I've ended up using an 'IsActive' column on tables.  I noticed...

posted @ Thursday, January 24, 2008 12:07 AM | Feedback (2)

Tiny little SQL trick with the IN clause

I don't know why I'd never used the IN clause in this manner before, but it just came to mind... I was writing an ad-hoc query against the sitemap table.  I needed to find any nodes where either the node label or node heading was "Course Section Mark Entry".  This felt clever: 1: SELECT * 2: FROM NavigationSitemap 3: WHERE ...

posted @ Wednesday, January 23, 2008 2:22 PM | Feedback (0)