Tag Archives: T-SQL
-
The identity column, the insert and the linked server.
4June 14, 2018 by Kenneth Fisher
tl;dr; When doing an insert across a linked server you have to include the list of fields to be inserted …
Continue reading -
Updated query to view data in the error log
5May 31, 2018 by Kenneth Fisher
This is one of my favorite scripts. It pulls all of the data from the error log and dumps it …
Continue reading -
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 -
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 -
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





