Category Archives: T-SQL
-
You can’t use GO in dynamic SQL.
2February 10, 2022 by Kenneth Fisher
This is one of those things that when I look back on it seems really obvious. Note: If at the …
Continue reading -
Who do you contact before an upgrade? : T-SQL Tuesday #147
1February 9, 2022 by Kenneth Fisher
I haven’t been blogging as much recently as I’d like and I’m trying to get back into it. One excellent …
Continue reading -
Commenting a branching IF-THEN-ELSE.
1October 19, 2021 by Kenneth Fisher
I’m a big fan of comments (MSSQL, Powershell), so along those lines here’s an interesting way to comment an IF-THEN-ELSE …
Continue reading -
Code examples : T-SQL Tuesday #143
Leave a commentOctober 12, 2021 by Kenneth Fisher
It’s TSQL Tuesday! John Armando McCormack (blog|twitter) is our host this month and he’d like us to share some of …
Continue reading -
Dealing with foreign keys when deleting rows.
2October 7, 2021 by Kenneth Fisher
Deleting rows from a table is a pretty simple task right? Not always. Foreign keys, while providing a ton of …
Continue reading -
Database Sizes
7September 14, 2021 by Kenneth Fisher
Quick query today. I needed a list of database sizes so came up with this: Nothing exciting, but I figure …
Continue reading -
Experiment: Does sp_recompile on a table update associated views.
2August 17, 2021 by Kenneth Fisher
tldr: No. You have to use sp_refreshview. One of the only good things to come out of all of the …
Continue reading -
Padding a string in SQL Server
3July 15, 2021 by Kenneth Fisher
I’ve been working on converting a piece of DB2 code into T-SQL and one of the functions I had to …
Continue reading -
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