- T-SQL Tuesday #015 – Automation (summary)
- T-SQL Tuesday #016 – Aggregation (summary)
- T-SQL Tuesday #017 – APPLY Knowledge (roundup)
- T-SQL Tuesday #018 – CTEs (wrapup)
- T-SQL Tuesday #019 – Disasters and Recovery (wrapup)
- T-SQL Tuesday #020 – T-SQL Best Practices (wrap-up)
- T-SQL Tuesday #021 – A Day Late and Totally Full of It
- T-SQL Tuesday #022 – Data Presentation (round-up)
- T-SQL Tuesday #023 – Joins (summary)
- T-SQL Tuesday #024- Prox N Funx (Summary)
- T-SQL Tuesday #025 – Invitation to share your tricks (summary)
It doesn’t seem that long ago that having cool little tidbits of information about SQL Server made a huge difference in how effective you could be. Well, that’s still true, but let me give you an example.
SELECT name FROM sysobjects WHERE sysstat & 4 > 0
In the early days of SQL Server, this was the way to pull a list of the names of all the stored procedures in your database. The 4 bit in the sysstat column represented stored procedures. (1 represented user tables and 2 represented view, as I recall, so changing the WHERE clause to read WHERE sysstat & 7 > 0 returned all tables, views and stored procedures.)
As SQL Server has evolved, Microsoft has made it easier to query the metadata to determine what objects existed, adding columns that helped (like ‘Type’ in this case), catalog views, Dynamic Management Objects, etc.
So, the challenge for this month’s T-SQL Tuesday is: What T-SQL tricks do you use today to make your job easier? (Notice I didn’t say PowerShell – I have a bunch of those now, but this is T-SQL Tuesday, not PowerShell Tuesday.)