Category Archives: T-SQL
-
Bulk insert and an identity column
1December 12, 2018 by Kenneth Fisher
TL;DR; BULK INSERT doesn’t have an easy way to specify a column list so the columns in the insert file …
Continue reading -
My backup script (where, how, how big, etc.)
5November 26, 2018 by Kenneth Fisher
A while back I wrote about how to find where your backups are. And I’ve also written about I use …
Continue reading -
SQL Homework – November 2018 – Constraints
2November 5, 2018 by Kenneth Fisher
You’ve created tables before but how about constraints? Constraints allow a finer level of control over what data is allowed …
Continue reading -
Highlighting sp_spaceused
1October 15, 2018 by Kenneth Fisher
I’ve been using sp_spaceused a lot recently so I thought I would bring it up again. Basically it’s a quick …
Continue reading -
Which is faster? IN (list) or IN (SELECT FROM Temp)
8October 11, 2018 by Kenneth Fisher
If you’ve done much with IN (list) then you’ve realized that it basically translates out to You’ve probably also realized …
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 -
You can’t DELETE TOP (x) with an ORDER BY
8September 19, 2018 by Kenneth Fisher
Did you know you can’t do this? Msg 156, Level 15, State 1, Line 8 Incorrect syntax near the keyword …
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





