Category Archives: T-SQL
-
Deleting a lot of data
5April 12, 2018 by Kenneth Fisher
I recently had the task of deleting a bit over a billion rows from a table. Now I could have …
Continue reading -
DB_NAME() vs ORIGINAL_DB_NAME()
1March 15, 2018 by Kenneth Fisher
I’d never seen ORIGINAL_DB_NAME until recently and I thought it would be interesting to highlight it out, and in particular …
Continue reading -
Windowing without a partition by or an order by
4February 21, 2018 by Kenneth Fisher
If you’ve never worked with windowing functions they look something like this: The other day someone mentioned that you could …
Continue reading -
Synonyms, how and why.
8February 15, 2018 by Kenneth Fisher
Did you know SQL Server has a thing called a synonym? It’s not something you see used very often even …
Continue reading -
What’s dbo?
6January 22, 2018 by Kenneth Fisher
Don’t you hate it how certain words (well, acronyms in this case) get reused to mean multiple things? dbo seems …
Continue reading -
Fun with sp_rename
Leave a commentJanuary 11, 2018 by Kenneth Fisher
Currently the only way to rename objects in SQL Server is to use sp_rename. Although that may be changing in …
Continue reading -
SQL Puzzle – Word Scrambler
2November 29, 2017 by Kenneth Fisher
I’ve been writing crosswords for the last few months and to change things up I thought I would do a …
Continue reading -
Variables in Dynamic SQL
4November 16, 2017 by Kenneth Fisher
I had someone ask me about this the other day. Specifically getting variable data out of a dynamic SQL statement. …
Continue reading -
SQL Homework Nov 2017: Create a view
3November 1, 2017 by Kenneth Fisher
Views are a highly useful tool for abstracting how you see the data stored in tables. At their simplest, they …
Continue reading -
Updateable CTEs
5October 18, 2017 by Kenneth Fisher
CTEs are cool things. You can essentially create one or more in-line view(s) within your query. One thing that isn’t …
Continue reading





