Tag Archives: code language
-
How do I tell if identity_insert is turned on and if so what table?
4June 24, 2022 by Kenneth Fisher
TLDR; The code to do this is below but it’s a bit hokey and probably isn’t worth it. It’s pretty …
Continue reading -
Running dynamic SQL in a different database
10May 19, 2022 by Kenneth Fisher
This is one of those things that on hindsight was a stupid problem, but still cost me hours and a …
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 -
Long names vs short names (or aliases)
9June 15, 2021 by Kenneth Fisher
I remember when I was first learning to code there was always the argument of how long a name should …
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 -
Generate a random number of children for each parent
4October 3, 2018 by Kenneth Fisher
I was asked an interesting question the other day. Is it possible to get a different random number of rows …
Continue reading -
Escaping strings
Leave a commentSeptember 24, 2018 by Kenneth Fisher
No, I’m not talking about that nightmare everyone has where a bunch of strings are chasing you across a loom. …
Continue reading -
Using Table Valued Parameters with sp_executesql
3September 13, 2018 by Kenneth Fisher
Recently I did a presentation on dynamic SQL. In the presentation I pointed out the similarity of using sp_executesql to …
Continue reading -
SQL Puzzle: Advent of Code
Leave a commentAugust 29, 2018 by Kenneth Fisher
A few years back someone started the Advent of code. If you aren’t familiar with it, it’s an advent calendar …
Continue reading -
Moving a table using BCP and native format
8March 21, 2018 by Kenneth Fisher
You need to move a table from one instance to another with the following requirements: The instances are on separate …
Continue reading