Category Archives: T-SQL
-
CROSS vs OUTER APPLY
2June 10, 2021 by Kenneth Fisher
I love CROSS APPLY. I also love OUTER APPLY. What’s the difference though? The same difference as with an INNER …
Continue reading -
Creating a configurable SSMS script
1May 18, 2021 by Kenneth Fisher
Several times over the last few weeks I’ve gotten a request to create a new work database. The individuals from …
Continue reading -
All jobs that ran during a given time frame.
2May 6, 2021 by Kenneth Fisher
Short post today. Simple query that will tell you every job that ran between two datetime stamps. Note: this of …
Continue reading -
SQL Homework – December 2020 – Participate in the Advent of Code.
Leave a commentDecember 3, 2020 by Kenneth Fisher
Christmas. Depending on where you live it’s a big deal even if you aren’t Christian. It pervades almost every aspect …
Continue reading -
A quick and dirty scan of a list of instances using a dynamic linked server.
5November 12, 2020 by Kenneth Fisher
Note: This is not exactly a dyanmic linked server. It just gets dropped and recreated in a loop. I recently …
Continue reading -
How do I test if a linked server works using T-SQL?
4October 27, 2020 by Kenneth Fisher
I get that linked servers are almost as despised as the dreaded cursor or (lord save us) NOLOCK, but they …
Continue reading -
HAL0004 – I don’t feel well Dave
1June 29, 2020 by Kenneth Fisher
It’s another HAL! Every once in a while (4 times now) I come up with a terrible terrible idea for …
Continue reading -
I created a table and SQL created a schema and a user.
1June 22, 2020 by Kenneth Fisher
Demo first and then I’ll explain what happened. First thing I did was run this script: CreateUsers.bat It’s a quick …
Continue reading -
End an ALTER DATABASE immediately if anyone is in the database.
5June 11, 2020 by Kenneth Fisher
The development team has told me they’ve shut down the application, there are no more connections and I can go …
Continue reading -
Use session_context to create a “variable” that lasts between batches.
15May 26, 2020 by Kenneth Fisher
The other day I had a brief conversation with Itzik Ben-Gan (about|twitter) on twitter and I have to tell you …
Continue reading





