Blog Posts
May 2024 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 -
Join 5 other subscribers
Category Archives: T-SQL Code Examples
A Little Fun With DateTime
A colleague asked me how to get the last day of the month for the current month using T-SQL. It’s an interesting problem, myself and another colleague both gave different answers to his question (which just goes to show that … Continue reading
Posted in T-SQL Code Examples
Tagged A Little Fun With DateTime, DATETIME, Last day of month, linkedin, T-SQL
Leave a comment
Changes To Exception Handling In SQL Server 2011
When SQL Server 2005 was released, we saw the introduction of structured exception handling using BEGIN TRY, BEGIN CATCH statements. This fantastic feature allowed us to trap and handle exceptions that we may encounter in the course of our code … Continue reading
Posted in SQL Server 2011 "Denali", T-SQL Code Examples
Tagged linkedin, RAISERROR, SQL Server 2011, THROW
3 Comments
Fun With SET Based Operations 2
Okay, now for a little more fun with SET based operations. This is a quick post that will show you how to combine multiple rows for 1 column, into a 1 row, 1 column, as a comma delimited list. It’s … Continue reading
Fun With Set Based Operations
Ok, maybe the title is a little misleading, perhaps fun is not quite the right word, perhaps it’s better to say ‘Something Interesting About Set Based Operations’, but it just doesn’t seem that catchy. You’ve probably worked with variables before, … Continue reading
Get the query text for specific SPID/session
Have you ever wanted to get the query text for a SPID to see what query is or was in use? Continue reading