The Bit Bucket

SDU Tools: TrainCase and KebabCase in T-SQL

SDU Tools: TrainCase and KebabCase in T-SQL

In our free SDU Tools for developers and DBAs, a number of the string formatting functions have been quite popular, and we keep getting requests for even more.

Today’s post highlights another two of these. TrainCase is words with the first letters capitalized, then separated by underscores. KebabCase has dashes as separators. It’s named because it looks like a kebab.

You can see them (and some others) in action in the main image above, and in this video:

2019-03-13

Opinion: A little plea to developers - no more desktop shortcuts by default

Opinion: A little plea to developers - no more desktop shortcuts by default

A quick piece today to talk about something that still seems to drive me crazy.

Why oh why do so many applications still default to putting a shortcut on the desktop when you’re installing them? And this applies to even very current applications.

I installed Chrome on some machines yesterday, and again, no question during install, but desktop shortcuts created.

Haven’t we moved on past this?

Nowadays, there really isn’t a need to plaster shortcuts all over the desktop for all the applications on the machine. And it’s counterproductive anyway.

2019-03-12

T-SQL 101: 8 What are tables in SQL Server?

T-SQL 101: 8 What are tables in SQL Server?

I mentioned previously that databases hold collections of information about related things. But what are these “things”? Well, that’s what the tables are.

Tables are the most basic objects that live in a database. They hold information about one type of thing. You might call the things “entities” but it’s not 100% accurate. It’s the same problem if you call them “objects”. They aren’t really objects. They basically are just “things” that we’re storing information about, like employees, books, cinemas, products, and more. ANSI SQL called them “relations”.

2019-03-11

Book Review: The Hard Thing About Hard Things

Book Review: The Hard Thing About Hard Things

I recently read The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers by Ben Horowitz. I was interested to read it because Ben is a well-known and experienced entrepreneur, based in the Silicon Valley area south of San Francisco. He offers advice on how to really run startups.

I loved the way that Horowitz addressed failure. Instead of taking the business school approach of telling you how things should be done, and assuming that you’ll do everything correctly, he spends time telling you what to do after you’ve already screwed up.

2019-03-08

Shortcut: Accessing script files and folders in SQL Server Management Studio

Shortcut: Accessing script files and folders in SQL Server Management Studio

This one is a very simple and quick tip.

When working in SQL Server Management Studio (SSMS), I often need to open File Explorer in the folder where the script file is stored. Turns out there is an easy way to do that.

There are two interesting options when you right-click the tab at the top of a query window:

Note that you can open the containing folder for the script. You can also copy the path to the script into the clipboard.

2019-03-07

SDU Tools: Screaming Snake Case and Sponge Bob Snake Case in T-SQL

SDU Tools: Screaming Snake Case and Sponge Bob Snake Case in T-SQL

In our free SDU Tools for developers and DBAs, a number of the string formatting functions have been quite popular, and we keep getting requests for even more.

Today’s post highlights two of these. Screaming Snake Case is words in capitals separated by underscores. Sponge Bob Snake Case has underscore separated words (hence the “snake case” part) with alternating capitals. (It’s just for fun).

You can see them (and some others) in action in the main image above, and in this video:

2019-03-06

SQL: The Down Side of a Low FILLFACTOR

SQL: The Down Side of a Low FILLFACTOR

When you create or rebuild an index in SQL Server, you can specify a FILLFACTOR value. It determines how full (as a percentage) that SQL Server should try to make the pages.

There is also one special value. Zero says “I haven’t set a value” and it applies the default, which by default, is 100%. Any value from 1 to 100 is the target percentage.

So why do people set lower values for FILLFACTOR? The argument is they know that their inserts are going to happen all over the table (i.e. not just neatly at the end of the table), and they’re trying to avoid page splits. And yes, lots of page splits can be a nasty thing. The most common problem case that people describe is where they’ve used a GUID as a clustering key (usually also a primary key) for a table. Then the inserts happen randomly throughout the table.

2019-03-05

T-SQL 101: 7 How are users different to logins in SQL Server?

T-SQL 101: 7 How are users different to logins in SQL Server?

One concept that often confuses newcomers to SQL Server is the difference between a login and a user.

In an earlier post, I mentioned that being authenticated to a server is what’s called a login. In this example shown, I have a log in here called Malathi. But as I said, this means nothing about what databases Malathi then has access to.

The connection between a login and a database is what the concept of a user is about.

2019-03-04

Book Review: The Little Things: Why You Really Should Sweat the Small Stuff

Book Review: The Little Things: Why You Really Should Sweat the Small Stuff

The title of this book caught my eye. I’m sure it’s intended to be a play on the title of  Don’t Sweat the Small Stuff and it’s all small stuff: Simple Ways to Keep the Little Things From Taking Over Your Life by Richard Carlson. I reviewed that book here.

So this one is The Little Things: Why You Really Should Sweat the Small Stuff by Andy Andrews.

Andrews tends to write small (and short) books that get pretty much to the point. This one also does the same. I saw a large number of people taking about how much they enjoyed it, but for me, it fell flat. In Carlson’s book, there were great messages about how easy it is to have your life overcrowded, particularly with things that in the end really don’t matter.

2019-03-01

Shortcut: Using Quick Launch in SQL Server Management Studio

Shortcut: Using Quick Launch in SQL Server Management Studio

In SQL Server Management Studio (SSMS) for SQL Server 2016, a new search tool called Quick Launch was added. It’s this bar up the top:

Note that there’s another bar underneath it to the left. That’s not the Quick Launch bar. That’s the Find bar.

While the Find bar is useful for searching for text within queries, etc., the Quick Launch bar is useful for searching within SSMS itself.

2019-02-28